Comments (3)
Sorry for the delayed response! Most of us are still on holiday vacation. :)
This looks like a bug in DirectMLX. When there is a single node in a graph, the dml::Graph::Compile
function is trying to eliminate some overhead by compiling the node as a standalone operator. This optimization only works when the bindings for the graph are identical to the bindings for the sole node in the graph. In your example they are not, since the graph input bindings do not include the third (optional) bias tensor for the convolution node.
The key thing to remember is that you're binding for the graph; you're not binding for the first node and last nodes in the graph. When you create a graph, you're effectively defining a new operator with its own bindings. Each call to dml::InputTensor
with a unique inputIndex
is adding another input binding to the graph. Your code is explicitly creating two input bind points for the graph:
auto input = dml::InputTensor(graph, 0, ...);
auto filter = dml::InputTensor(graph, 1, ...);
However, you could have declared the input and filter tensors in the opposite order:
auto filter = dml::InputTensor(graph, 0, ...);
auto input = dml::InputTensor(graph, 1, ...);
Either way, the graph itself only has two inputs. The graph inputs are wired to the node inputs based on the expressions you pass in: since you call dml::Convolution(input, filter)
it will wire the graph's input at whatever index the input
and filter
tensors have when you called dml::InputTensor
. It's a little easier to explain with a figure:
Pinging @adtsai (our binding expert) for his thoughts when he's back from vacation, but I believe we should remove this optimization or somehow detect when it's possible to do safely. For now, you can comment out lines 630-638 to work around.
from directml.
Some one can comment this for me ? :)
from directml.
thanks. So the "graph compiler" will deal with the optional binding automatically.
from directml.
Related Issues (20)
- [Question] Any good first issues?
- DirectML in UWP apps?
- Unable to eun float16 onnx model only float32
- NPU support in DirectML want to deploy yolov8n
- How to Install DirectML on Windows? HOT 2
- future plans for torch-directml HOT 2
- How to install torch-directml(cpuonly) on linux?
- why DirectML isn't being further promoted HOT 3
- use transformers RuntimeError: tensor.device().type() == at::DeviceType::PrivateUse1 INTERNAL ASSERT FAILED at HOT 1
- RuntimeError: Could not allocate tensor with 234881024 bytes. There is not enough GPU video memory available! HOT 2
- Intel NPU HOT 1
- Hi, please help on aten::softplus.out HOT 3
- UserWarning: Set seed for `privateuseone` device does not take effect.. HOT 4
- Torch-DirectML Layer Norm Produces Incorrect Result with Non-contiguous Input HOT 2
- NPU dmlDevice not loading HOT 1
- Issue-Report: PyTroch v. 0.2.1.dev240521 - Dropout no longer working HOT 1
- UserWarning: The operator 'aten::native_dropout' is not currently supported on the DML backend HOT 1
- cbuffers with arrays and using dxdispatch.
- Operator aten::upsample_bicubic2d.out HOT 1
- torch directml bug
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 directml.