Replies: 1 comment
-
|
The To verify that Transformer Engine is actually using FP8, you can try the following:
If you're using a standard Hugging Face Transformer model without replacing its layers with Transformer Engine modules (or using an integration that performs this replacement), then Could you also share:
That would help determine whether FP8 kernels are actually expected to be used in your setup. If this answer helped or pointed you in the right direction, I'd appreciate it if you could mark it as the accepted answer so it's easier for others with the same issue to find. Also, if you found my contribution useful, I'd appreciate it if you could check out my GitHub profile, follow me, and star any repositories you find interesting. GitHub: https://github.com/Advait251206 |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, I am using this code for HF transformer model inference. Is there is way I can actually verify that the model is using fp8 precision like print out debug logs or something showing fp8 precision?
fp8_recipe = recipe.DelayedScaling(fp8_format=recipe.Format.E4M3)
def generate_fp8(prompt):
with te.fp8_autocast(enabled=True, fp8_recipe=fp8_recipe):
inputs = tokenizer(prompt, return_tensors="pt").to("cuda")
print(f"Input tensor dtype: {inputs['input_ids'].dtype}") # this shows dtype: torch.int64
outputs = model.generate(**inputs, max_length=50)
thanks
Beta Was this translation helpful? Give feedback.
All reactions