Skip to content
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

FP8 causes exception: name te not defined #1276

Closed
JulesGM opened this issue Apr 2, 2023 · 11 comments · Fixed by #1287
Closed

FP8 causes exception: name te not defined #1276

JulesGM opened this issue Apr 2, 2023 · 11 comments · Fixed by #1287

Comments

@JulesGM
Copy link
Contributor

JulesGM commented Apr 2, 2023

System Info

Accelerate 0.18.0
Transformers 4.27.4
Torch 2.0.0

Reproduction

When launching with mixed_precision=fp8 in the config_file, I get

name te is not defined

@muellerzr
Copy link
Collaborator

Hi @JulesGM, this should be solved via #1283

Can you do pip install git+https://github.com/huggingface/accelerate to double check? :)

@JulesGM
Copy link
Contributor Author

JulesGM commented Apr 3, 2023

hello @muellerzr , I get ImportError: Using 'has_transformer_engine_layers' requires transformer_engine to be installed.

@JulesGM
Copy link
Contributor Author

JulesGM commented Apr 3, 2023

Screen Shot 2023-04-03 at 12 48 19 PM

@muellerzr
Copy link
Collaborator

muellerzr commented Apr 3, 2023

That is correct, have you installed the transformer engine on your system? :) (As the error suggests, both it and the required hardware are needed)

@JulesGM
Copy link
Contributor Author

JulesGM commented Apr 3, 2023

No I have not. But it is a weird error to get. I did not know I needed transformer_engine to use fp8, I just selected the option because I saw it in accelerate config

@JulesGM
Copy link
Contributor Author

JulesGM commented Apr 3, 2023

hmm also, it's only on H100s, ok, sad. I was hoping it would also be ok with A100 somehow.

@JulesGM
Copy link
Contributor Author

JulesGM commented Apr 3, 2023

No I have not. But it is a weird error to get. I did not know I needed transformer_engine to use fp8, I just selected the option because I saw it in accelerate config.

I suggest that the library checks if transformer_engine is installed, and raises if it's not, explaining that it's required. It would be more clean than this.

@JulesGM
Copy link
Contributor Author

JulesGM commented Apr 3, 2023

Like this, it makes one think it could be a bug.

@muellerzr
Copy link
Collaborator

Thanks @JulesGM, that does indeed make sense. Should be addressed via #1287, need to see with Sylvain if we want to raise that in the CLI as well (since config files can be swapped/passed through machines). However this will raise the right error when running the script now more clearly

@JulesGM
Copy link
Contributor Author

JulesGM commented Apr 3, 2023

cool thanks. I can close this if you want

@muellerzr
Copy link
Collaborator

Sure :)

@JulesGM JulesGM closed this as completed Apr 3, 2023
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 a pull request may close this issue.

2 participants