Skip to content

Fix torch_memory_saver LD_PRELOAD path for CUDA-suffixed binaries - #1785

Merged
guapisolo merged 1 commit into
mainfrom
fix-tms-preload-path
Jul 24, 2026
Merged

Fix torch_memory_saver LD_PRELOAD path for CUDA-suffixed binaries#1785
guapisolo merged 1 commit into
mainfrom
fix-tms-preload-path

Conversation

@yueming-yuan

Copy link
Copy Markdown
Collaborator

Problem

Since torch_memory_saver was upgraded to 0.0.9.post1 (#1773, #1774), the package ships CUDA-major-suffixed preload binaries (e.g. torch_memory_saver_hook_mode_preload_cu13.abi3.so) instead of the old unsuffixed torch_memory_saver_hook_mode_preload.abi3.so.

miles/ray/train/actor_factory.py still hardcodes the old unsuffixed filename and asserts it exists, so every offload_train megatron run on the current :dev image dies at startup:

AssertionError: LD_PRELOAD so file .../torch_memory_saver_hook_mode_preload.abi3.so does not exist.

This is currently red on main's own offload_train megatron path and blocks unrelated PRs (surfaced while monitoring #1261's stage-c-8-gpu CI).

Fix

Use the package-provided get_binary_path_from_package("torch_memory_saver_hook_mode_preload") helper, which resolves the correct CUDA-suffixed variant (and raises a clear error itself if none is found, so the hand-written assert is no longer needed).

Validation

On a radixark/miles:dev B300 devbox (torch_memory_saver 0.0.9.post1):

>>> from torch_memory_saver.utils import get_binary_path_from_package
>>> get_binary_path_from_package("torch_memory_saver_hook_mode_preload")
/usr/local/lib/python3.12/dist-packages/torch_memory_saver_hook_mode_preload_cu13.abi3.so   # exists

pre-commit passes.

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

torch_memory_saver 0.0.9.post1 ships CUDA-major-suffixed preload
binaries (torch_memory_saver_hook_mode_preload_cu13.abi3.so), but
actor_factory hardcoded the old unsuffixed name and asserted it exists,
breaking every offload_train megatron run. Use the package's
get_binary_path_from_package helper to resolve the right variant.
@yueming-yuan
yueming-yuan force-pushed the fix-tms-preload-path branch from 94aaa29 to acf71ab Compare July 24, 2026 06:39

@guapisolo guapisolo left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM.

@guapisolo
guapisolo merged commit 54ed128 into main Jul 24, 2026
37 checks passed
@guapisolo
guapisolo deleted the fix-tms-preload-path branch July 24, 2026 07:38
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