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
(TorchSampler.__init__, SpecWorkerBase) with a clear ImportError, so
sampling_utils stays importable for torch-only consumers (AutoDeploy demollm,
drafting greedy helpers).
- IS_FLASHINFER_AVAILABLE semantics are unchanged (its ~46 legitimate fallback
consumers are not touched).
- ops/flashinfer.py: keep flashinfer.sampling behind an import guard so the
module stays importable without flashinfer; ops are only reached after the
hard-dependency check at construction time.
- TorchSampler.__init__ enforces the hard dependency once (out of the
CUDA-graph-captured loop) before selecting the grouped sampler class.
- Flatten the single-implementation grouped sampler: drop the
GroupedStrategySampler ABC and keep only FlashInferGroupedStrategySampler.
- 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