Skip to content

Versions greater than 4.49 are not compatible with Ascend NPU #37992

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
4 tasks
1737686924 opened this issue May 7, 2025 · 3 comments
Closed
4 tasks

Versions greater than 4.49 are not compatible with Ascend NPU #37992

1737686924 opened this issue May 7, 2025 · 3 comments
Labels

Comments

@1737686924
Copy link

System Info

910B1,python==3.10,transformers==4.51.0

Who can help?

Image
When torch==2.2.0 and torch-npu==2.2.0 and transformers>4.49, the error "AssertionError: Torch not compiled with CUDA enabled" will appear. <=4.49 has no problem. Upgrading to torch==2.4.0 and torch-npu==2.4.0 and transformers>4.49 allows training, but the graphics card cannot be specified. By default, it starts from card 0.

Information

  • The official example scripts
  • My own modified scripts

Tasks

  • An officially supported task in the examples folder (such as GLUE/SQuAD, ...)
  • My own task or dataset (give details below)

Reproduction

When torch==2.2.0 and torch-npu==2.2.0 and transformers>4.49, the error "AssertionError: Torch not compiled with CUDA enabled" will appear. <=4.49 has no problem. Upgrading to torch==2.4.0 and torch-npu==2.4.0 and transformers>4.49 allows training, but the graphics card cannot be specified. By default, it starts from card 0.

Expected behavior

When torch==2.2.0 and torch-npu==2.2.0 and transformers>4.49, the error "AssertionError: Torch not compiled with CUDA enabled" will appear. <=4.49 has no problem. Upgrading to torch==2.4.0 and torch-npu==2.4.0 and transformers>4.49 allows training, but the graphics card cannot be specified. By default, it starts from card 0.

@1737686924 1737686924 added the bug label May 7, 2025
@Rocketknight1
Copy link
Member

cc @ivarflakstad, with apologies!

@ivarflakstad
Copy link
Member

Hey!
Just as a general note when you decide to use an older version of one library (torch in this instance) it is not completely unexpected that you would get issues with newer versions of another (transformers in this instance). Transformers supports a fairly wide range of torch, but when using torch-npu I'd recommend a smaller range as the entire ecosystem around npus is less mature. That's true for any software btw, not specific to transformers, torch, etc.

Have you tried torch* > 2.4.0?

@1737686924
Copy link
Author

I discovered the problem. I upgraded torch*==2.5.1 and solved this problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants