Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 4k
[AutoTVM][TOPI] Fix bifrost spatial packing conv2d auto tune#5684
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
1499d0abf727f9f2e7fd3cc8c7bcFile filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -142,11 +142,7 @@ def _schedule_spatial_pack(cfg, s, output, conv, data_vec, kernel_vec): | ||
| s[data_vec].unroll(vw) | ||
| if isinstance(kernel_vec.op, tvm.te.ComputeOp) and kernel_vec.name == 'kernel_vec': | ||
| if autotvm.GLOBAL_SCOPE.in_tuning: | ||
| # kernel packing will be pre-computed during compilation, so we skip | ||
| # this part to make tuning records correct | ||
| s[kernel_vec].pragma(s[kernel_vec].op.axis[0], 'debug_skip_region') | ||
| else: | ||
| if not autotvm.GLOBAL_SCOPE.in_tuning: | ||
| max_threads = tvm.target.Target.current(allow_none=False).max_num_threads | ||
| co, ci, kh, kw, vc = s[kernel_vec].op.axis | ||
| fused = s[kernel_vec].fuse(co, ci, kh, kw, vc) | ||
| @@ -313,10 +309,15 @@ def upround(x, align): | ||
| data_pad[n][c][h][w], | ||
| name='d') | ||
| if pre_computed: | ||
| U = kernel | ||
| if autotvm.GLOBAL_SCOPE.in_tuning: | ||
| VC = cfg['tile_k'].size[-1] | ||
| kvshape = (KH + tile_size - 1, KW + tile_size - 1, tvm.tir.indexdiv(CO, VC), CI, VC) | ||
| U = tvm.te.placeholder(kvshape, kernel.dtype, name="U") | ||
| else: | ||
| U = _decl_winograd_kernel_transform(kernel, tile_size, G) | ||
| if pre_computed: | ||
| U = kernel | ||
| else: | ||
| U = _decl_winograd_kernel_transform(kernel, tile_size, G) | ||
| # V [alpha * alpha, C, P_round) | ||
| # Perform the image transform | ||
| @@ -370,12 +371,7 @@ def _schedule_winograd(cfg, s, op): | ||
| s[G].compute_inline() | ||
| eps, _, _, _ = s[U].op.axis | ||
| y, _, _, _ = s[padded_kernel].op.axis | ||
| if autotvm.GLOBAL_SCOPE.in_tuning: | ||
| # Kernel transformation will be pre-computed during compilation, so we skip | ||
| # this part to make tuning records correct | ||
| s[U].pragma(eps, 'debug_skip_region') | ||
| s[padded_kernel].pragma(y, 'debug_skip_region') | ||
| else: | ||
| if not autotvm.GLOBAL_SCOPE.in_tuning: | ||
| ||
| # Pad kernel | ||
| y, x, ky, kx = s[padded_kernel].op.axis | ||
| s[padded_kernel].unroll(ky) | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change schedule for arm_cpu conv2d as well?