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

Fix breakage problem when using custom_ar #4052

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

kkHuang-amd
Copy link
Contributor

@kkHuang-amd kkHuang-amd commented Mar 4, 2025

Motivation

Run the moel test and found below error is reported

==============================================
File "/root/sglang-0.4.3post3_car/python/sglang/srt/managers/scheduler.py", line 1887, in run_scheduler_process
    scheduler = Scheduler(server_args, port_args, gpu_id, tp_rank, dp_rank)
  File "/root/sglang-0.4.3post3_car/python/sglang/srt/managers/scheduler.py", line 243, in __init__
    self.tp_worker = TpWorkerClass(
  File "/root/sglang-0.4.3post3_car/python/sglang/srt/managers/tp_worker_overlap_thread.py", line 63, in __init__
    self.worker = TpModelWorker(server_args, gpu_id, tp_rank, dp_rank, nccl_port)
  File "/root/sglang-0.4.3post3_car/python/sglang/srt/managers/tp_worker.py", line 68, in __init__
    self.model_runner = ModelRunner(
  File "/root/sglang-0.4.3post3_car/python/sglang/srt/model_executor/model_runner.py", line 192, in __init__
    min_per_gpu_memory = self.init_torch_distributed()
  File "/root/sglang-0.4.3post3_car/python/sglang/srt/model_executor/model_runner.py", line 268, in init_torch_distributed
    initialize_model_parallel(tensor_model_parallel_size=self.tp_size)
  File "/root/sglang-0.4.3post3_car/python/sglang/srt/distributed/parallel_state.py", line 1116, in initialize_model_parallel
    _TP = init_model_parallel_group(
  File "/root/sglang-0.4.3post3_car/python/sglang/srt/distributed/parallel_state.py", line 943, in init_model_parallel_group
    return GroupCoordinator(
  File "/root/sglang-0.4.3post3_car/python/sglang/srt/distributed/parallel_state.py", line 263, in __init__
    self.ca_comm = CustomAllreduce(
  File "/root/sglang-0.4.3post3_car/python/sglang/srt/distributed/device_communicators/custom_all_reduce.py", line 281, in __init__
    self.meta = ops.allocate_meta_buffer(ops.meta_size() + max_size)
  File "/root/sglang-0.4.3post3_car/python/sglang/srt/_custom_ops.py", line 124, in meta_size
    return sgl_kernel.ops.meta_size()
AttributeError: module 'sgl_kernel.ops' has no attribute 'meta_size'
=====================================================

Check the path in sgl-kernel, ops is separated multiple files from init.py

Modifications

Change _custom_ops.py to specify the correct calling path

Checklist

Copy link
Collaborator

@HaiShaw HaiShaw left a comment

Choose a reason for hiding this comment

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

LG

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants