Comments (3)
The forward of my model does contain the opeation of explict cuda mem copy, that's why it requires to retrieve cuda stream.
You code indirectly call these ops which doesn't return Tensor. I think it's not hard to support these functions. I can take a look if you have a repro.
from torchdynamo.
@yanboliang Thanks for the reply. You can use the following mini repo. Additionally, there should be similar request for torch.cuda.device.
import torch
import torch.nn as nn
import torch._dynamo as dynamo
from torch.nn.parallel._functions import _get_stream
class CopyModel(nn.Module):
def __init__(self):
super(CopyModel, self).__init__()
def forward(self, input, device):
self.copy_stream = torch.cuda.Stream(device)
with torch.cuda.stream(self.copy_stream):
return input.cuda()
model = CopyModel()
output = model(torch.rand(1000), 1)
print(output.get_device())
opt_model = dynamo.optimize('eager')(model)
output = opt_model(torch.rand(1000), 1)
print(output.get_device())
from torchdynamo.
Closing it as it works with pytorch nightly build
from torchdynamo.
Related Issues (20)
- TMPDIR ignored
- how to get the path of the generated triton codes (triton code and its generated IRs)? HOT 2
- compiled model run in v100 GPU is slower HOT 6
- Fake Tensor Fails for codegen model HOT 3
- crash when enabled triton matmul HOT 1
- Unable to reporduce Hugging Face model example shown for PyTorch 2.0 HOT 3
- PT2.0 max-autotune mode fails for resnet34 HOT 2
- How to use the new autotune intoruced in https://github.com/pytorch/torchdynamo/pull/1338 HOT 3
- MMCLS Resnet-50 failed training, got 'Triton Error [CUDA]: invalid device context' HOT 6
- 3% Memory Regression when Compiling the Optimizer HOT 2
- [Inductor] [CPU] Accuracy failure in torchbench model Super_SloMo on WW03.2 HOT 1
- [Inductor] [CPU] Accuracy failure in huggingface model XLNetLMHeadModel on WW03.2 HOT 1
- [Inductor] [CPU] Accuracy failure in timm model cait_m36_384 on WW03.2 HOT 1
- [Inductor] [CPU] Accuracy failure in timm model jx_nest_base on WW03.2 HOT 1
- torch._inductor.lowering: [WARNING] using triton random, expect difference from eager HOT 1
- Add support for tagging parameters in export
- dead links in README and TROUBLESHOOTING. HOT 2
- torch.compile cannot accelerate GPTBigCode inference process HOT 1
- LoweringException: IndexError: list index out of range HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from torchdynamo.