DeepSpeed
5b6da2be - remove the dead non-Triton attention path from TritonSelfAttention (#8349)

Commit
28 days ago
remove the dead non-Triton attention path from TritonSelfAttention (#8349) ## Problem `TritonSelfAttention.forward` had a fallback branch that called `self.ds_compute_attention(...)`, reachable only when `alibi is not None` or when the caller passed `use_triton_attention=False`. The call site misspelled the keyword as `toke_idx=`, so the branch raised `TypeError: ds_compute_attention() got an unexpected keyword argument 'toke_idx'` on every entry — i.e. it had never executed. ## Fix Per @delock's review, the branch is dead rather than broken, so it is removed instead of repaired: - delete `TritonSelfAttention.ds_compute_attention` - drop the now-unused `SoftmaxContextOp` import and `self.score_context_func` - drop the `use_triton_attention=True` parameter from `forward` (grep over the repo finds no other reference to it — `attention.py` was the only file) - the remaining `alibi is not None` case now raises `NotImplementedError("TritonSelfAttention does not support alibi")` Net `-37/+2` in one file. `minus_inf` is kept — it is still used by the Triton kernel at `attention.py:300`. `python -m py_compile` and `pyflakes` are clean on the result (the one `pyflakes` note, `v_offset` assigned but never used at line 255, is pre-existing in the Triton kernel and untouched here). 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Signed-off-by: Anai-Guo <antai12232931@outlook.com> Signed-off-by: Tai An <antai12232931@outlook.com> Co-authored-by: Ma, Guokai <guokai.ma@gmail.com>
Author
Parents
Loading