Module Ir.Hip_limits

Pure HIP device-class classification and cost-model advisory rate selection, extracted from Hip_backend so that multi-device combinations (including mixed integrated+discrete hosts not present in the hardware fleet) can be pinned without the hipjit toolkit or hardware (test/operations/hip_ranking_rates, gh-ocannl-2532).

type device_summary = {
  1. integrated : bool;
  2. gcn_arch_name : string;
  3. warp_size : int;
}
val sexp_of_device_summary : device_summary -> Sexplib0.Sexp.t
val equal_device_summary : device_summary -> device_summary -> bool
val is_rdna_wave32 : gcn_arch_name:string -> warp_size:int -> bool

Whether a single HIP device is an RDNA3/RDNA3.5+ (gfx11/gfx12) wave32 part. Shared with Hip_backend's tile_mma_eligible and all_rdna_wave32 gates.

val all_rdna_wave32 : device_summary array -> bool

Whether the host has at least one device and every device satisfies is_rdna_wave32.

type ranking_rates = {
  1. cache_capacity : int option;
  2. cache_rate : float option;
  3. scalar_rate : float option;
  4. dram_rate : float option;
  5. saturation_threads : int option;
  6. sector_rate : float option;
  7. workgroup_capacity : int option;
  8. copy_rate : float option;
  9. idle_rate : float option;
  10. shared_rate : float option;
  11. lane_width : int option;
  12. sync_rate : float option;
}

The device-class and RDNA-wave32 ranking-rate fields Hip_backend populates on Backend_intf.hardware_limits, named after Backend_intf.untimed_limits.

val sexp_of_ranking_rates : ranking_rates -> Sexplib0.Sexp.t
val equal_ranking_rates : ranking_rates -> ranking_rates -> bool
val ranking_rates : wave:int -> device_summary array -> ranking_rates

Advisory cost-model ranking rates for a HIP host's device set at wavefront width wave. Pure unified (all integrated) and pure discrete (all non-integrated) RDNA wave32 hosts receive their calibrated rates; mixed integrated+discrete hosts take the discrete base class (cache_capacity, cache_rate, scalar_rate, dram_rate, saturation_threads) and physical workgroup_capacity, while leaving sector_rate, copy_rate, idle_rate, shared_rate, and lane_width unset so an integrated GPU is never moved by discrete staging or register-reuse rates.