Skip to content

Remove dead code in sampler.py#19

Closed
sunway513 wants to merge 1 commit intomainfrom
fix/sampler-dead-code
Closed

Remove dead code in sampler.py#19
sunway513 wants to merge 1 commit intomainfrom
fix/sampler-dead-code

Conversation

@sunway513
Copy link
Owner

Summary

  • Remove unreachable code after return sampled_tokens on line 33
  • Remove unused greedy_sample and random_sample methods
  • Remove unused imports (softmax, topk) that were only used by the dead methods

The mixed_sample_outer_exponential call already handles both greedy (temp=0) and random sampling in a single fused kernel.

Test plan

  • Existing ATOM E2E benchmarks (GPT-OSS, DeepSeek R1) use this sampler — no behavior change since the removed code was unreachable

The Triton-based greedy_sample/random_sample methods and their
imports (softmax, topk) were unreachable after the early return
on line 33. The mixed_sample_outer_exponential call already
handles both greedy (temp=0) and random sampling paths.
@sunway513
Copy link
Owner Author

Already merged upstream at ROCm/ATOM via commit 043b31c by HaonanWang98. Closing.

@sunway513 sunway513 closed this Feb 23, 2026
@sunway513 sunway513 deleted the fix/sampler-dead-code branch February 23, 2026 04:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant