Skip to main content

matches_sm_suffix

Function matches_sm_suffix 

Source
pub(crate) fn matches_sm_suffix(name: &str, sm: &str) -> bool
Expand description

Returns true when name is a TRT engine plan basename whose _smXX suffix matches the requested SM exactly.

ORT names every TRT engine plan with a _smXX.engine suffix tied to the GPU compute capability that built it (sm75 = T4, sm86 = A10G, sm89 = L40S/L4, sm120 = Blackwell). The match must be strictsm12 must not match sm120.engine, or a B200 worker would happily believe a Hopper plan is usable. We accomplish this by anchoring on the leading underscore: the suffix tested is "_{sm}.engine", so _sm12.engine and _sm120.engine occupy disjoint string sets.

Pure, no I/O — easy to unit-test.