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
3 changes: 2 additions & 1 deletion lightllm/common/basemodel/layer_weights/hf_load_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ def load_hf_weights(data_type, weight_dir, pre_post_layer=None, transformer_laye
transformer_layer_list=transformer_layer_list,
weight_dir=weight_dir,
) # noqa
worker = int(os.environ.get("LOADWORKER", 1))
cpu_count = min(16, os.cpu_count() or 4)
worker = min(cpu_count, len(candidate_files))
with Pool(worker) as p:
iterator = p.imap_unordered(partial_func, candidate_files, chunksize=1)
desc_str = f"pid {os.getpid()} Loading model weights with {worker} workers"
Expand Down
2 changes: 1 addition & 1 deletion lightllm/common/fused_moe/grouped_topk.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def _compare_and_swap(x, x_1, ids, flip, i: tl.core.constexpr, n_dims: tl.core.c
iright = right.to(idtype, bitcast=True)
ix = x.to(idtype, bitcast=True)

cond = (left > right) ^ flip
cond = ((left > right) ^ flip) > 0

ret = ix ^ tl.core.where(cond, ileft ^ iright, zeros_like(ix))

Expand Down