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

Improve error messaging during trt-llm export #9638

Merged
merged 14 commits into from
Jul 8, 2024
Merged
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
10 changes: 10 additions & 0 deletions nemo/export/trt_llm/converter/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,16 @@ def split_and_save_weight(tp_rank, saved_dir, split_factor, key, vals, storage_t

# Split the QKV to separate variables.
qkv = np.split(val, [q_num, q_num + 1], axis=2)

query_groups_shape = qkv[0].shape
if len(query_groups_shape) > 1:
if (query_groups_shape[1] % split_factor) != 0:
raise Exception(
"Number of query groups of the models is {0}. Please select tensor parallelism size "
"that can split the number of query groups to equal number of query matrices in the "
"each GPU.".format(query_groups_shape[1])
)

q_split = np.split(qkv[0], split_factor, axis=1)
k_split = np.split(qkv[1], split_factor, axis=1)
v_split = np.split(qkv[2], split_factor, axis=1)
Expand Down
Loading