Comments (5)
can you paste a copy of ir after tvm.lower?
from tvm.
It seems it does not do the compute-inline. But it does get into this line of traverse (nhwc version): https://github.com/dmlc/tvm/blob/master/topi/python/topi/cuda/depthwise_conv2d_map.py#L107
Does the scale shift and relu also has layout to be considered?
// attr [DepthwiseConv2d] storage_scope = "global"
allocate DepthwiseConv2d[float32 * 1 * 64 * 64 * 728]
produce DepthwiseConv2d {
// attr [iter_var(blockIdx.x, , blockIdx.x)] thread_extent = 1024
// attr [Filter.shared] storage_scope = "shared"
allocate Filter.shared[float32 * 3 * 3 * 728 * 1]
produce Filter.shared {
for (ax0, 0, 3) {
for (ax1, 0, 3) {
// attr [iter_var(threadIdx.x, , threadIdx.x)] thread_extent = 728
Filter.shared[((((ax0*3) + ax1)728) + threadIdx.x)] = Filter[(((((blockIdx.x/1024)728) + (ax02184)) + (ax1728)) + threadIdx.x)]
}
}
}
for (i.inner, 0, 2) {
for (j.inner, 0, 2) {
// attr [iter_var(threadIdx.x, , threadIdx.x)] thread_extent = 728
DepthwiseConv2d[(((((((blockIdx.x/1024)*728) + (((blockIdx.x % 1024) % 32)1456)) + (((blockIdx.x % 1024)/32)93184)) + (i.inner46592)) + (j.inner728)) + threadIdx.x)] = 0.000000f
for (di, 0, 3) {
for (dj, 0, 3) {
DepthwiseConv2d[(((((((blockIdx.x/1024)*728) + (((blockIdx.x % 1024) % 32)1456)) + (((blockIdx.x % 1024)/32)93184)) + (i.inner46592)) + (j.inner728)) + threadIdx.x)] = (DepthwiseConv2d[(((((((blockIdx.x/1024)*728) + (((blockIdx.x % 1024) % 32)1456)) + (((blockIdx.x % 1024)/32)93184)) + (i.inner46592)) + (j.inner728)) + threadIdx.x)] + (select(((((((1 - di) - i.inner) <= (((blockIdx.x % 1024)/32)*2)) && ((((blockIdx.x % 1024)/32)*2) < ((65 - di) - i.inner))) && (((1 - dj) - j.inner) <= (((blockIdx.x % 1024) % 32)*2))) && ((((blockIdx.x % 1024) % 32)2) < ((65 - dj) - j.inner))), Input[((((((((((blockIdx.x % 1024) % 32)1456) + (((blockIdx.x % 1024)/32)93184)) + (i.inner46592)) + (j.inner728)) + (((blockIdx.x/1024)728) + threadIdx.x)) + (di46592)) + (dj728)) + -47320)], 0.000000f)Filter.shared[((((((blockIdx.x/1024)728) + threadIdx.x) + (di2184)) + (dj728)) - ((blockIdx.x/1024)728))]))
}
}
}
}
}
produce ScaleShift {
for (c, 0, 64) {
for (i, 0, 64) {
for (j, 0, 728) {
ScaleShift[((((c64) + i)728) + j)] = ((DepthwiseConv2d[((((c64) + i)*728) + j)]*Scale[c]) + Shift[c])
}
}
}
}
from tvm.
@tqchen The problem is that scale shift supports only NCHW layout. I will add another layout to it. Thank you!
from tvm.
Unfortunately, the problem remains. Here is the tvm.lower:
// attr [DepthwiseConv2d] storage_scope = "global"
allocate DepthwiseConv2d[float32 * 1 * 64 * 64 * 728]
produce DepthwiseConv2d {
// attr [iter_var(blockIdx.x, , blockIdx.x)] thread_extent = 1024
// attr [Filter.shared] storage_scope = "shared"
allocate Filter.shared[float32 * 3 * 3 * 728 * 1]
produce Filter.shared {
for (ax0, 0, 3) {
for (ax1, 0, 3) {
// attr [iter_var(threadIdx.x, , threadIdx.x)] thread_extent = 728
Filter.shared[((((ax0*3) + ax1)728) + threadIdx.x)] = Filter[(((((blockIdx.x/1024)728) + (ax02184)) + (ax1728)) + threadIdx.x)]
}
}
}
for (i.inner, 0, 2) {
for (j.inner, 0, 2) {
// attr [iter_var(threadIdx.x, , threadIdx.x)] thread_extent = 728
DepthwiseConv2d[(((((((blockIdx.x/1024)*728) + (((blockIdx.x % 1024) % 32)1456)) + (((blockIdx.x % 1024)/32)93184)) + (i.inner46592)) + (j.inner728)) + threadIdx.x)] = 0.000000f
for (di, 0, 3) {
for (dj, 0, 3) {
DepthwiseConv2d[(((((((blockIdx.x/1024)*728) + (((blockIdx.x % 1024) % 32)1456)) + (((blockIdx.x % 1024)/32)93184)) + (i.inner46592)) + (j.inner728)) + threadIdx.x)] = (DepthwiseConv2d[(((((((blockIdx.x/1024)*728) + (((blockIdx.x % 1024) % 32)1456)) + (((blockIdx.x % 1024)/32)93184)) + (i.inner46592)) + (j.inner728)) + threadIdx.x)] + (select(((((((1 - di) - i.inner) <= (((blockIdx.x % 1024)/32)*2)) && ((((blockIdx.x % 1024)/32)*2) < ((65 - di) - i.inner))) && (((1 - dj) - j.inner) <= (((blockIdx.x % 1024) % 32)*2))) && ((((blockIdx.x % 1024) % 32)2) < ((65 - dj) - j.inner))), Input[((((((((((blockIdx.x % 1024) % 32)1456) + (((blockIdx.x % 1024)/32)93184)) + (i.inner46592)) + (j.inner728)) + (((blockIdx.x/1024)728) + threadIdx.x)) + (di46592)) + (dj728)) + -47320)], 0.000000f)Filter.shared[((((((blockIdx.x/1024)728) + threadIdx.x) + (di2184)) + (dj728)) - ((blockIdx.x/1024)728))]))
}
}
}
}
}
produce ScaleShift {
for (i, 0, 64) {
for (j, 0, 64) {
for (c, 0, 728) {
ScaleShift[((((i64) + j)728) + c)] = ((DepthwiseConv2d[((((i64) + j)*728) + c)]*Scale[c]) + Shift[c])
}
}
}
}
Thank you!
from tvm.
This is because the schedule does not successfully fused the compute into scaleshift, and schedule shift computation becomes CPU computation
from tvm.
Related Issues (20)
- [Bug] Unable to build TVM with LLVM 19
- [Docs] A typo in tvm.relay.frontend HOT 1
- [BUG]: Relay.transform.FoldScaleAxis() Error in folding the SqueezeExcitation structure of mobilenetv3. HOT 2
- TVM performs convolution time performance issues.
- [Bug] Building for qualcomm hexagon dsp V66 architeture HOT 5
- [Bug] tvm/src/contrib/torch/tvm_module_wrapper/RuntimeModuleWrapperTVM.cc:32:10: fatal error: ../../support/base64.h: No such file or directory
- [Bug] [Relax] [TIR] FuseOps and FuseTIR cannot fuse no-op reshape into other `PrimFunc`s, nor can they eliminate that
- [Tracking Issue] Remove `distutils` dependency from the codebase
- [Relax][Bug] CodeGenVM cannot handle this intrinsic tensor_to_shape HOT 2
- [Relax][Bug] Cannot find PackedFunc tir_zeros HOT 7
- [Release] v0.17.0 Release Candidate Notes
- [VOTE] Release Apache TVM v0.17.0.rc0 HOT 7
- [Bug] pytorch relax frontend failed to import models with torch.permute
- [Bug] Building erros for hexagon_launcher HOT 5
- [Bug] Conflicting code is generated in lib0.c causing conflicting types for tvmgen_default_run and tvmgen_default__tvm_main__
- [Bug] Error opening FastRPC channel HOT 6
- [RESULT][VOTE] Release Apache TVM v0.17.0
- [Bug] onnx quantize op support MatMulIntegerToFloat QLinearConv
- [Bug] [Relax] InternalError: Check failed: (*it).second == var HOT 3
- [Bug] [Relax] cannot remove the hint_on_device HOT 5
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 tvm.