Skip to content

Commit b2bd536

Browse files
committed
fix: add compat shim for Nemotron's is_flash_attn_greater_or_equal_2_10
The function was renamed to is_flash_attn_greater_or_equal in transformers 5.x, but Nemotron's HF Hub remote code still imports the old name. Inject a compatibility wrapper before model loading.
1 parent d745e9f commit b2bd536

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

src/instructlab/training/model.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,17 @@ def __init__(
8484
if self.is_granitemoehybrid or self.is_nemotronh:
8585
self._use_local_mamba_kernels()
8686

87+
# Compatibility shim for Nemotron's HF Hub remote code which imports
88+
# is_flash_attn_greater_or_equal_2_10, renamed in transformers 5.x.
89+
if self.is_nemotronh:
90+
# Third Party
91+
from transformers.utils import import_utils as _iu
92+
93+
if not hasattr(_iu, "is_flash_attn_greater_or_equal_2_10"):
94+
_iu.is_flash_attn_greater_or_equal_2_10 = lambda: (
95+
_iu.is_flash_attn_greater_or_equal("2.10")
96+
)
97+
8798
if self.is_gpt_oss:
8899
# Third Party
89100
quant_config = Mxfp4Config(dequantize=True)

0 commit comments

Comments
 (0)