Conversation
Cohere Transcribe can keep relative-position biases in fp32 while the query is fp16. Cast both biases to the query dtype before the attention matmuls so Turing GPU inference does not fail with a mixed dtype error. Fixes vllm-project#54377 Co-authored-by: OpenAI Codex <noreply@openai.com> Signed-off-by: jikuixie <jikuixie@gmail.com>
|
Hi @ActiveSky - thanks for the PR! The issue was that the Can you do that instead in this PR and confirm it works on your Turing GPU? |
Keep relative-position bias buffers in the configured runtime dtype when loading checkpoint values. This prevents mixed-dtype attention matmuls on Turing GPUs and adds a regression test for the loading path. Fixes vllm-project#54377 Co-authored-by: OpenAI Codex <noreply@openai.com> Signed-off-by: jikuixie <jikuixie@gmail.com>
|
Hi @ekagra-ranjan, thank you for the detailed diagnosis and for testing the alternative on H100. We checked the loading path and confirmed that the custom pos_bias conversion changes the shared relative-position bias buffers to the checkpoint dtype, overriding the runtime dtype. We updated this PR to remove that conversion and restored the original attention additions. We also added a regression test covering FP32 checkpoint values loaded into FP16 runtime buffers and a corresponding attention forward pass. The focused test, .venv/bin/python -m pytest tests/model_executor/test_cohere_asr.py -v, passed, and the project pre-commit checks passed. The update is in commit fee8e03. Could you please take another look when convenient? Thank you again for your guidance. |
|
@ActiveSky - after #55190 is merged, could you move the testfile you created in this PR to |
|
Hi @ekagra-ranjan, thank you for the follow-up suggestion. We’ve noted it and will keep an eye on #55190. Once #55190 is merged, we’ll update this PR to move the test file to |
Summary
Fixes #54377.
When Cohere Transcribe runs with
--dtype float16on Turing GPUs, therelative-position biases can remain in
torch.float32while the query is intorch.float16. Adding the bias promotes the query to FP32, and the followingmatmul with the FP16 positional projection fails during engine initialization.
Cast both relative-position biases to the query dtype before the addition, and
add a CPU regression test for the mixed-dtype forward path.
Duplicate-work check
gh issue view 54377 --repo vllm-project/vllm --comments: no comments orclaimants, and no linked pull request.
gh pr list --repo vllm-project/vllm --state open --search "54377 in:body":no results.
(lazy
librosaimport); neither changes the relative-position attentiondtype path addressed here.
Testing
.venv/bin/python -m pytest tests/model_executor/test_cohere_asr.py -v(1passed)
pre-commit run --files vllm/model_executor/models/cohere_asr.py tests/model_executor/test_cohere_asr.py(passed)
pre-commit run mypy-3.12 --files vllm/model_executor/models/cohere_asr.py tests/model_executor/test_cohere_asr.py --hook-stage manual(passed)
AI assistance
AI assistance from OpenAI Codex was used to investigate the issue, implement the
change, and run the validation above. The human submitter must review every
changed line and be able to explain and defend the change end-to-end.