Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add SMEM as a supported Pallas output memory space. #25689

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
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: 2 additions & 0 deletions jax/_src/pallas/mosaic/pallas_call_registration.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ def _get_memory_space_from_aval(
return None
case tpu_core.TPUMemorySpace.VMEM:
return tpu_custom_call.MemorySpace.VMEM
case tpu_core.TPUMemorySpace.SMEM:
return tpu_custom_call.MemorySpace.SMEM
case tpu_core.TPUMemorySpace.SEMAPHORE:
return tpu_custom_call.MemorySpace.SEMAPHORE_MEM
return None
Expand Down
3 changes: 3 additions & 0 deletions jax/_src/tpu_custom_call.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ class MemorySpace(enum.Enum):
HBM = enum.auto()
VMEM = enum.auto()
SEMAPHORE_MEM = enum.auto()
SMEM = enum.auto()

@property
def color(self) -> int:
Expand All @@ -92,6 +93,8 @@ def color(self) -> int:
return 1
elif self == MemorySpace.SEMAPHORE_MEM:
return 2
elif self == MemorySpace.SMEM:
return 4
else:
raise ValueError("invalid memory space: " + str(self))

Expand Down
Loading