THUDM / THUDM/slime

[Bug] W&B initialization fails with wandb 0.28.2 because wandb.util.generate_id was removed

Open Beginner friendly
#2,332 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Python
Stars
8.5k
Forks
1.3k
Avg merge
5h 36m
Merged PRs (30d)
22

Description

Bug Description

On the latest Slime main branch, init_wandb_primary() calls wandb.util.generate_id() when wandb_random_suffix is enabled.

wandb.util.generate_id() is no longer available in W&B 0.28.2, so W&B initialization fails with an AttributeError before training starts. The same code path works with W&B 0.28.1, where the legacy wrapper still exists.

Steps to Reproduce
  1. Check out Slime main at commit a3f5009 or a version containing the same call in slime/observability/wandb_utils.py.
  2. Install wandb==0.28.2.
  3. Run the following minimal reproduction:
from types import SimpleNamespace

from slime.observability.wandb_utils import init_wandb_primary

args = SimpleNamespace(
    use_wandb=True,
    wandb_mode="offline",
    wandb_key=None,
    wandb_host=None,
    wandb_random_suffix=True,
    wandb_group="wandb-repro",
    rank=0,
)

init_wandb_primary(args)
Expected Behavior

Slime should generate the random W&B group suffix and continue initializing the run.

Actual Behavior

W&B initialization fails before wandb.init() is called:

Traceback (most recent call last):
  File ".../slime/observability/wandb_utils.py", line 45, in init_wandb_primary
    group = args.wandb_group + "_" + wandb.util.generate_id()
                                      ^^^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'wandb.util' has no attribute 'generate_id'

### Environment

- Slime version: `main` at `a3f5009`
- Python version: 3.12.3
- W&B version: 0.28.2
- PyTorch version: not relevant; the failure occurs before training starts
- CUDA/ROCm version: not relevant
- GPU type and count: not relevant
- OS: Ubuntu 24.04
- SGLang version: not relevant
- Megatron-LM version: not relevant

### Logs

```shell

Additional Context

W&B 0.28.1 still provides wandb.util.generate_id() as a legacy wrapper, but W&B 0.28.2 removes it. The run-ID generator remains available from wandb.sdk.lib.runid in W&B 0.28.2.

One possible fix is:

from wandb.sdk.lib.runid import generate_id

group = args.wandb_group + "_" + generate_id()

I verified this replacement with both wandb==0.28.1 and wandb==0.28.2 using an offline unit test.

Pre-submission Checklist
  • I have read the CONTRIBUTING.md and understand the collaboration scope.
  • I have read the documentation and my issue is not addressed there.
  • I have searched for existing issues and this is not a duplicate.
  • I have provided a minimal, reproducible example.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in slime/observability/wandb_utils.py at init_wandb_primary() and reproduce the failure with wandb==0.28.2 using the offline example from the issue. Verify that W&B initialization succeeds with wandb_random_suffix enabled under both wandb==0.28.1 and 0.28.2, using the offline unit test mentioned in the report.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
observability
Issue type
Bug
Difficulty
1/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
90/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.