question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support Intel Arc

See original GitHub issue

Hi, Is it possible to support Intel Arc as a device, as it is done with apple ARM(MPS), nvidia GPU(GPU) or tpus, so I don’t have to change the code using the intel extension?

import torch
import torch.nn as nn
# Import intel_extension_for_pytorch
import intel_extension_for_pytorch as ipex

# oneDNN graph fusion is enabled by default, uncomment the line below to disable it explicitly
# ipex.enable_onednn_fusion(False)

class Model(nn.Module):
    def __init__(self):
        super(Model, self).__init__()
        self.linear = nn.Linear(4, 5)

    def forward(self, input):
        return self.linear(input)

input = torch.randn(2, 4)
model = Model()
model.eval()
# Invoke optimize function against the model object
model = ipex.optimize(model, dtype=torch.float32)
model = torch.jit.trace(model, torch.randn(2, 4))
model = torch.jit.freeze(model)
res = model(input)

Intel Extension

cc @borda @akihironitta @justusschock

Issue Analytics

  • State:open
  • Created 10 months ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
awaelchlicommented, Nov 12, 2022

This looks great. @johnnynunez do you know if calling ipex.optimize jointly on the optimizer and model is required for training? Or would it be ok to call them separately?

model = ipex.optimize(model, dtype=torch.float32)
optimizer = ipex.optimize(optimizer, dtype=torch.float32)

instead of

model, optimizer = ipex.optimize(model, optimizer, dtype=torch.float32)

?

One could investigate whether creating a IntelCPUAccelerator is enough to support this in Lightning Trainer.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Support for Intel® Arc™ A-Series Graphics
Find support information for Intel® Arc™ A-Series Graphics, which may include featured content, downloads, specifications, or warranty.
Read more >
Intel® Arc™ A-Series Graphics – Desktop Quick Start Guide
In order to ensure you get the best gaming experiences from Intel® Arc™ A-Series Desktop Graphics, a supported hardware configuration is required, ...
Read more >
Intel® Arc™ Graphics Drivers
Learn about the latest Intel® Arc™ Graphic information and get drivers that will help bring your gaming experience to the next level.
Read more >
Support for Intel® Arc™ A380 Graphics
Find support information for Intel® Arc™ A380 Graphics, which may include featured content, downloads, specifications, or warranty.
Read more >
Intel® Arc™ Graphics Windows* DCH Driver
Intel ® Game On Driver support on Intel® Arc™ A-series Graphics for: World of Warcraft: Dragonflight*; Warhammer 40K: Darktide*; Marvel's Midnight Suns* ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found