Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jaxtyping
fastapi[standard]<0.137.0
flax==0.12.8
torchax==0.0.13
qwix==0.1.2
qwix>=0.1.8
torchvision==0.25.0
pathwaysutils
parameterized
Expand Down
8 changes: 7 additions & 1 deletion tpu_inference/layers/common/fused_moe_gmm.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,12 @@ def gmm_wrapper(lhs,
group_offset,
fuse_act=None,
preferred_element_type=None):
gmm_res = gmm_v2(
try:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With this change now all GMM accumulates in f32, i think this is will impact performance for our native model runs.

The real issue is that maxtext models do not properly support fp8 weights, so the fix really should exist on the maxtext side.

from qwix._src.interception import disable_interceptions
target_gmm = disable_interceptions(gmm_v2)
except Exception:
target_gmm = gmm_v2
gmm_res = target_gmm(
lhs=lhs,
rhs=rhs,
rhs_scale=rhs_scale,
Expand All @@ -118,6 +123,7 @@ def gmm_wrapper(lhs,
zero_initialize=False,
fuse_act=fuse_act,
preferred_element_type=preferred_element_type,
acc_dtype=jnp.float32,
)
return gmm_res

Expand Down
Loading