Meet "uses too much shared data" error when run build.relay

I convert a vit model from onnx, and then run relay.build

with tvm.transform.PassContext(opt_level=3):
    lib = relay.build(mod, target=target, params=params)

and then meet an error like this: ptxas error : Entry function ‘tvmgen_default_fused_nn_conv2d_kernel0’ uses too much shared data (0x6d68c bytes, 0xc000 max)

i use tvm-0.9 and cuda-10.1 and gcc-7.3

i’m a newcomer for tvm , and how can i fix this problem .

Thanks!

PS. When i use the tvm-0.8 ,I can successfully execute this code. Is there any difference between 0.8 and 0.9?

1 Like

It’s probably due to the fact that the shared memory usage of the default schedule is too much for your model. You need to tune for your model + device.

1 Like

@masahi Thanks for your reply!

and How can i tune the shared memory size for the model.

I mean, tuning is not just for shared memory size, but for the entire schedules. See for example Auto-scheduling a Neural Network for NVIDIA GPU — tvm 0.10.dev0 documentation

@masahi OK! i will try it

Thanks very much!!

Did you solved? I have same issue…

Did you solved? I have same issue…

In my understanding, I use s[A_shared].compute_at(s[C], mi) The shared memory size depend on where you compute_at.