Skip to content

[step 1]refine code to support all devices in torch#1879

Open
wenhuach21 wants to merge 25 commits into
mainfrom
refine_device_1
Open

[step 1]refine code to support all devices in torch#1879
wenhuach21 wants to merge 25 commits into
mainfrom
refine_device_1

Conversation

@wenhuach21
Copy link
Copy Markdown
Contributor

@wenhuach21 wenhuach21 commented Jun 1, 2026

Description

Please briefly describe your main changes, the motivation.

Type of Change

Bug fix

Related Issues

Fixes or relates to #

Checklist Before Submitting

  • My code has been tested locally.
  • Documentation has been updated as needed.
  • New or updated tests are included where applicable.
  • The CUDA CI has passed. You can trigger it by commenting /azp run Unit-Test-CUDA-AutoRound.
  • 优化manager下面的那些函数

Copilot AI review requested due to automatic review settings June 1, 2026 08:39
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors device handling by introducing a unified DeviceManager abstraction and updating existing utilities to use it, with the intent of reducing scattered backend-specific (cuda/xpu/hpu) branching across the codebase.

Changes:

  • Added auto_round/utils/device_manager.py to centralize backend discovery and runtime ops (sync/cache/memory queries).
  • Updated auto_round/utils/device.py to route device counting, selection, memory clearing, and memory queries through the new device manager APIs.
  • Updated auto_round/auto_scheme/delta_loss.py to synchronize via the active device manager and broaden “non-CPU device” checks.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
auto_round/utils/device.py Replaces backend-specific device/memory logic with DeviceManager calls.
auto_round/utils/device_manager.py New unified device backend abstraction (discovery + runtime + memory APIs).
auto_round/auto_scheme/delta_loss.py Uses DeviceManager for synchronization and generalized non-CPU device checks.

Comment thread auto_round/utils/device_manager.py Outdated
Comment thread auto_round/utils/device_manager.py
Comment thread auto_round/utils/device_manager.py
@chensuyue
Copy link
Copy Markdown
Contributor

/azp run Unit-Test-CUDA-AutoRound

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@wenhuach21 wenhuach21 changed the title refine devices refine code to support all devices in torch Jun 2, 2026
@chensuyue
Copy link
Copy Markdown
Contributor

/azp run Unit-Test-CUDA-AutoRound

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@wenhuach21
Copy link
Copy Markdown
Contributor Author

/azp run Unit-Test-CUDA-AutoRound

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@wenhuach21 wenhuach21 changed the title refine code to support all devices in torch [step 1]refine code to support all devices in torch Jun 4, 2026
@chensuyue
Copy link
Copy Markdown
Contributor

/azp run Unit-Test-CUDA-AutoRound

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

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.

3 participants