Skip to content

Commit 46d1f47

Browse files
authored
FP8 attention knob for nvFP4 recipe (NVIDIA#2818)
1 parent 28c586e commit 46d1f47

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

megatron/core/fp4_utils.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,9 @@ def get_fp4_recipe(config: TransformerConfig):
8686
if is_te_min_version("2.7.0.dev0"):
8787
if config.fp4_recipe == Fp4Recipe.nvfp4:
8888
try:
89-
fp4_recipe = transformer_engine.common.recipe.NVFP4BlockScaling()
89+
fp4_recipe = transformer_engine.common.recipe.NVFP4BlockScaling(
90+
fp8_dpa=config.fp8_dot_product_attention
91+
)
9092
except AttributeError:
9193
raise ValueError(
9294
"""NVFP4BlockScaling recipe is not available in this version of

0 commit comments

Comments
 (0)