You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[TRTLLM-13212][refactor] Make FlashInfer a hard dependency for Torch sampler and spec
Convert the Torch sampler and one-model speculative decoding from
"FlashInfer-optional with torch fallback" to a hard FlashInfer dependency.
The failure is raised at sampler / speculative-worker construction time
(resolve_sampling_backend, SpecWorkerBase) via a new require_flashinfer
helper and a sentinel-based bind_flashinfer_sampling, so sampling_utils
stays importable for torch-only consumers (AutoDeploy demollm, drafting
greedy helpers).
- Add require_flashinfer() in flashinfer_utils.py; IS_FLASHINFER_AVAILABLE
semantics are unchanged (its ~46 legitimate fallback consumers are not
touched).
- ops/flashinfer.py: drop the import guard, bind flashinfer.sampling at
construction via a sentinel; compiled bodies do no import work.
- Remove the SimpleGroupedStrategySampler torch backend and the
disable_flashinfer_sampling LlmArg + its plumbing; update the api_stability
and usage golden files and the sampling/telemetry docs.
- compute_probs_from_logits becomes FlashInfer-only (drop the CUDA C++ op and
CPU vanilla branches).
- speculative/interface.py: drop the availability guards, keep the
flashinfer>=0.6.4 version gate and its version-gated branches.
- Delete now-dead fallback kernels (forward_native_sampling,
_apply_top_k_top_p, _random_sample, vanilla.compute_probs_from_logits_op);
keep beam-search/greedy/rejection/_Fusions and the torch sample() path used
by rejection-sampling draft probs and demollm.
- Prune torch-vs-flashinfer parametrized sampler tests.
Signed-off-by: ZhaoyangWang <zhaoyangw@nvidia.com>
0 commit comments