Skip to content

Conversation

@jiqing-feng
Copy link
Contributor

The triton kernel didn't consider model on multi-card. To reproduce the error, run ZE_AFFINITY_MASK=2,3 python test_triton_bnb.py on the following script:

from transformers import pipeline

pipe = pipeline("text-generation", model="hugging-quants/Meta-Llama-3.1-8B-Instruct-BNB-NF4", device_map="auto")
print(pipe.model.hf_device_map)
output = pipe("Hello, my name is", max_new_tokens=10)
print(output)

The error is:

AssertHandler::printMessage
/pytorch/third_party/torch-xpu-ops/src/ATen/native/xpu/sycl/TensorCompareKernels.cpp:163: operator(): global id: [0,0,0], local id: [0,0,0] Assertion `input_[0] != 0` failed.
Aborted (core dumped)

After this PR, the output be like:

[{'generated_text': 'Hello, my name is Dr. Smith and I am a professor of mathematics'}]

@jiqing-feng jiqing-feng marked this pull request as ready for review July 1, 2025 03:00
@jiqing-feng
Copy link
Contributor Author

Hi @matthewdouglas . Do you mind reviewing this PR? Thanks!

@matthewdouglas matthewdouglas added this to the v0.47.0 milestone Jul 1, 2025
@matthewdouglas matthewdouglas self-requested a review July 1, 2025 15:38
@matthewdouglas
Copy link
Member

LGTM, thanks for the fix!

@matthewdouglas matthewdouglas merged commit bdcee0f into bitsandbytes-foundation:main Jul 1, 2025
39 checks passed
@github-actions
Copy link

github-actions bot commented Jul 1, 2025

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants