Record Class GenAIOliveTarget

java.lang.Object
java.lang.Record
smile.onnx.genai.GenAIOliveTarget
Record Components:
candidateId - GenAI cascade id (cuda, dml, cpu, …).
device - Olive --device (gpu, npu, cpu).
provider - Olive --provider EP name.
defaultPrecision - preferred Olive --precision when unset (fp8 or int4).

public record GenAIOliveTarget(String candidateId, String device, String provider, String defaultPrecision) extends Record
Olive optimize target derived from the GenAI EP cascade.
  • Constructor Details

    • GenAIOliveTarget

      public GenAIOliveTarget(String candidateId, String device, String provider, String defaultPrecision)
      Creates an instance of a GenAIOliveTarget record class.
      Parameters:
      candidateId - the value for the candidateId record component
      device - the value for the device record component
      provider - the value for the provider record component
      defaultPrecision - the value for the defaultPrecision record component
  • Method Details

    • prefersFp8

      public boolean prefersFp8()
      Returns whether this target prefers FP8 when auto-selecting precision.
      Returns:
      true for CUDA (and similar) FP8-capable targets.
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • candidateId

      public String candidateId()
      Returns the value of the candidateId record component.
      Returns:
      the value of the candidateId record component
    • device

      public String device()
      Returns the value of the device record component.
      Returns:
      the value of the device record component
    • provider

      public String provider()
      Returns the value of the provider record component.
      Returns:
      the value of the provider record component
    • defaultPrecision

      public String defaultPrecision()
      Returns the value of the defaultPrecision record component.
      Returns:
      the value of the defaultPrecision record component