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

Added ranks 96 and 128 to BGMV kernel #630

Merged
merged 1 commit into from
Oct 3, 2024
Merged
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
4 changes: 2 additions & 2 deletions server/lorax_server/utils/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@


MAX_BATCH_SIZE = int(os.environ.get("LORAX_COMPILE_MAX_BATCH_SIZE", 96))
MAX_RANK = int(os.environ.get("LORAX_COMPILE_MAX_RANK", BGMV_MAX_RANK))
MAX_RANK = int(os.environ.get("LORAX_COMPILE_MAX_RANK", 64))

SLOT_PAD_VALUE = -1
SEGMENT_PAD_VALUE = -1
Expand All @@ -43,7 +43,7 @@

# Include 0 to ensure we can use cuda graphs without adapters
# TODO(travis): use padding to allow for more ranks without increasing memory usage
CACHED_MAX_RANKS = [0, 8, 16, 32, 64]
CACHED_MAX_RANKS = [0, 8, 16, 32, 64, 96, 128]
CACHED_MAX_RANKS = [r for r in CACHED_MAX_RANKS if r <= MAX_RANK]
_allowed_ranks = set(CACHED_MAX_RANKS)

Expand Down
2 changes: 1 addition & 1 deletion server/lorax_server/utils/sgmv.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
MIN_RANK_CUSTOM = 16
MAX_RANK_CUSTOM = 128
SGMV_BLOCK_SIZE = 16
BGMV_MAX_RANK = 64
BGMV_MAX_RANK = 128


def has_sgmv() -> bool:
Expand Down
4 changes: 3 additions & 1 deletion server/punica_kernels/punica_kernels/bgmv/bgmv_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ void bgmv_kernel(T *__restrict__ Y, const T *__restrict__ X,
FOR_BGMV_WIDE(f, T, 8) \
FOR_BGMV_WIDE(f, T, 16) \
FOR_BGMV_WIDE(f, T, 32) \
FOR_BGMV_WIDE(f, T, 64)
FOR_BGMV_WIDE(f, T, 64) \
FOR_BGMV_WIDE(f, T, 96) \
FOR_BGMV_WIDE(f, T, 128)

// clang-format on
Loading