Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

[Bug] Float8CurrentScaling / Float8BlockScaling: fp8_quant_* QParams ignore use_power_2_scales / use_f32_scales passed to the constructor

Cerrado
#3,593 2 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 2 días

@Varun-51 ya está trabajando en esto.

Desde el 1/10/2026.

  • #3603 de @efegokdemir — cerrado sin fusionar
  • #3604 de @Varun-51 — cerrado sin fusionar
  • #3605 de @Varun-51 — abierto

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
75/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
python

Línea de trabajo

Read the Float8CurrentScaling and Float8BlockScaling definitions in transformer_engine/common/recipe/init.py, then compare their QParams construction with NVFP4BlockScaling.post_init. Reproduce on CPU using the provided constructor examples with environment defaults set to 0. Done when explicit constructor values are reflected in the corresponding fp8_quant_* QParams, while omitted arguments still use environment-variable defaults.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

bug

If use_power_2_scales (Float8CurrentScaling) or use_f32_scales (Float8BlockScaling) is passed to the constructor with a value different from its environment-variable default, the recipe reports the new value but its fp8_quant_* QParams retain the old value:

Float8CurrentScaling(use_power_2_scales=True)
use_power_2_scales = True
fp8_quant_fwd_inp.power_2_scale = False # expected True

Float8BlockScaling(use_f32_scales=True)
use_f32_scales = True
fp8_quant_fwd_inp.power_2_scale = True # expected False

Nothing raises an error, so the recipe configuration and the associated QParams can silently disagree.

Root cause (as far as I can tell)

In transformer_engine/common/recipe/init.py, fp8_quant_fwd_inp, fp8_quant_fwd_weight, and fp8_quant_bwd_grad are constructed in the class body using the class-level use_power_2_scales / use_f32_scales values.

They have no type annotation, so they are not dataclass fields. The QParams are therefore constructed once when the class is defined/imported. Passing an explicit value to the constructor changes the instance attribute, but does not rebuild the existing QParams.

NVFP4BlockScaling in the same file constructs its fp4_quant_* QParams in post_init, so those QParams are built per instance.

To Reproduce

NVTE_FP8_CURRENT_SCALING_POWER_2_SCALES=0

NVTE_FP8_BLOCK_SCALING_FP32_SCALES=0

python repro.py

from transformer_engine.common.recipe import (
Float8CurrentScaling,
Float8BlockScaling,
)

r = Float8CurrentScaling(use_power_2_scales=True)
print(r.use_power_2_scales, r.fp8_quant_fwd_inp.power_2_scale)

True False

r = Float8BlockScaling(use_f32_scales=True)
print(r.use_f32_scales, r.fp8_quant_fwd_inp.power_2_scale)

True True

This reproduces on CPU; no GPU or CUDA execution is required.

Expected behavior

The fp8_quant_* QParams should be constructed per instance from the effective recipe configuration, similar to NVFP4BlockScaling.

For example:

r = Float8CurrentScaling(use_power_2_scales=True)
assert r.use_power_2_scales is True
assert r.fp8_quant_fwd_inp.power_2_scale is True

r = Float8BlockScaling(use_f32_scales=True)
assert r.use_f32_scales is True
assert r.fp8_quant_fwd_inp.power_2_scale is False

The environment variables should still provide the default values when the corresponding constructor arguments are not passed.

Happy to work on this once assigned. Thanks

Lenguaje dominante
Python
Estrellas
3.6k
Forks
862
Merge medio
4 d 18 h
PR fusionados (30 d)
64

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de NVIDIA/TransformerEngine

Todos los issues de NVIDIA/TransformerEngine

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.