Skip to content

fix: Fix _get_accelerator_memory#44

Open
svskvar wants to merge 2 commits into
mainfrom
dtensor_get_memory_info_fix
Open

fix: Fix _get_accelerator_memory#44
svskvar wants to merge 2 commits into
mainfrom
dtensor_get_memory_info_fix

Conversation

@svskvar
Copy link
Copy Markdown

@svskvar svskvar commented Apr 28, 2026

Issue #, if available:

Description of changes:
Fix _get_accelerator_memory in test/distributed/tensor/debug/test_debug_mode.py to handle cases where no accelerator is available or the accelerator backend doesn't support mem_get_info. Adds early-return guards that:

  1. Check torch.accelerator.is_available() before querying memory
  2. Verify the device module has mem_get_info support before calling get_memory_info

Returns 0 in both cases, which allows the test to be properly skipped on unsupported backends (e.g., PrivateUse1 devices).

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

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.

1 participant