Skip to content

moe: offloaded models are never removed from the expert registry #173

Closed

Description

@gspark-etri

Problem

_LAYERS only grows and each OffloadedLayer holds all tier handles (host expert tensors and GPU slots). OffloadReport.release() frees leases but not layers, so reloading a model in a server keeps the old experts in host and GPU memory.

Evidence and reproduction

opt_prime/opt_prime/accel/moe/ops.py:20-29. Ran: apply -> release -> del -> gc three times gave 2 -> 4 -> 6 registered layers.

Environment

optimus-rm @253be20; Python 3.10, torch 2.10.0+cu128, transformers 5.1.0; RNGD+A100 host (CPU / one A100 for the checks).

Scope

moe/ops.py, OffloadReport.

Done when

release() unregisters its layers; a test checks the registry is empty after release.

Owner

@gspark-etri

Activity

  1. gspark-etri commented on Oct 23, 2026

    @gspark-etri
    CollaboratorAuthor

    Fixed by #182, squash-merged into optimus-rm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions