Skip to content

removing ipex, and fixing multigpu detection help from @AbrarFaiyad - #1522

Open
alvarovm wants to merge 2 commits into
ACEsuit:mainfrom
alvarovm:main
Open

removing ipex, and fixing multigpu detection help from @AbrarFaiyad#1522
alvarovm wants to merge 2 commits into
ACEsuit:mainfrom
alvarovm:main

Conversation

@alvarovm

@alvarovm alvarovm commented Jul 13, 2026

Copy link
Copy Markdown

We propose to remove IPEX modules for Intel XPU training and ASE calculator. IPEX was retired (archived) by Intel in favor of XPU support within Pytorch >=2.8.
We also fixed the support for multigpu and multinode training on large Intel GPU clusters.


Note

Medium Risk
Touches distributed training device mapping on XPU clusters; behavior change for users who still relied on IPEX, but scope is limited to Intel XPU paths.

Overview
Removes Intel Extension for PyTorch (IPEX) from the ASE MACECalculator and run_train.py, including all ipex.optimize paths, in favor of native torch.xpu support in recent PyTorch.

XPU startup no longer requires importing IPEX/oneCCL; it only logs when --device=xpu is set but torch.xpu is missing. Distributed XPU now clamps torch.xpu.set_device when local_rank exceeds the visible device count, and DDP uses device_ids=[0] when each process sees a single XPU (e.g. under ZE_AFFINITY_MASK), avoiding overflow errors from invalid local_rank device IDs.

Reviewed by Cursor Bugbot for commit bc9674a. Configure here.

@cursor

cursor Bot commented Jul 13, 2026

Copy link
Copy Markdown

Bugbot couldn't run

Bugbot is not enabled for your user on this team.

Ask your team administrator to increase your team's hard limit for Bugbot seats or add you to the allowlist in the Cursor dashboard.

1 similar comment
@cursor

cursor Bot commented Jul 13, 2026

Copy link
Copy Markdown

Bugbot couldn't run

Bugbot is not enabled for your user on this team.

Ask your team administrator to increase your team's hard limit for Bugbot seats or add you to the allowlist in the Cursor dashboard.

@ilyes319

Copy link
Copy Markdown
Contributor

@cursor review

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using high effort and found 3 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Want reviews to match your repository better? Bugbot Learning can learn team-specific rules from PR activity. A team admin can enable Learning in the Cursor dashboard.

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit bc9674a. Configure here.

Comment thread mace/cli/run_train.py Outdated
Comment thread mace/cli/run_train.py
Comment thread mace/cli/run_train.py
logging.error(
"Intel Extension for PyTorch not found, but XPU device was specified. "
"Please install it to use XPU device."
)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Evaluation DDP lacks XPU fix

High Severity

After training, distributed post-training evaluation rebuilds DDP with device_ids=[local_rank] and skips the XPU pinning added earlier. On Intel layouts where each process sees one tile and local_rank can exceed the visible device index, this can hit the same DDP overflow that the new _ddp_dev logic avoids during the main training loop.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit bc9674a. Configure here.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

This is fine. Here model is not distributed.

Removed check for XPU device availability in PyTorch in run_train.py.

This is already checked later at init_device()  in mace/tools/torch_tools.py#L67

@alvarovm alvarovm left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Removed useless warnings. Reviewed code.

@aacostadiaz aacostadiaz 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.

Thanks for this cleanup! I've left a few comments below.

Since we don't have Intel hardware in CI, we can't test any of the XPU paths ourselves. Could you re-run a multi-node job on your cluster once the comments are addressed and confirm it works end to end?

Comment thread mace/cli/run_train.py
# after param.requires_grad = False was called before evaluating stage-one model
for param in model.parameters():
param.requires_grad = True
distributed_model = DDP(model, device_ids=[local_rank])

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.

There's a second DDP here in the final evaluation loop that still uses the raw local_rank. I think this is the line the bot was actually referring to in https://github.com/ACEsuit/mace/pull/1522/changes/BASE..bc9674a8dfaf1310cec5c53f7e4e2265abae9370#r3574263042

distributed_model = DDP(model, device_ids=[_ddp_dev])

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

torch >2.8 DDP supports Intel CCL back-end.

Comment thread mace/cli/run_train.py
update_keyspec_from_kwargs(args.key_specification, vars(args))

if args.device == "xpu":
try:

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.

I think removing this import breaks distributed XPU. Importing oneccl_bindings_for_pytorch was what registered the "ccl" backend and distributed_tools.py still calls init_process_group(backend="ccl") for xpu

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

The oneccl_bindings_for_pytorch is also retired per intel see https://github.com/intel/torch-ccl

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