Skip to content

Conversation

@kxyk99
Copy link

@kxyk99 kxyk99 commented Jan 22, 2026

Motivation

Technical Details

Test Plan

Test Result

Submission Checklist

@kxyk99 kxyk99 requested a review from a team January 22, 2026 08:39
Comment on lines +10 to +12
padding_same = lambda i, w, stride, dilation: math.ceil(
(stride * (i - 1) + 1 + dilation * (w - 1) - i) / 2
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [ruff] <E731> reported by reviewdog 🐶
Do not assign a lambda expression, use a def

Suggested change
padding_same = lambda i, w, stride, dilation: math.ceil(
(stride * (i - 1) + 1 + dilation * (w - 1) - i) / 2
)
def padding_same(i, w, stride, dilation):
return math.ceil(
(stride * (i - 1) + 1 + dilation * (w - 1) - i) / 2
)

Comment on lines +14 to +16
out_padding = lambda i, w, padding, stride, dilation: int(
(i + 2 * padding - dilation * (w - 1) - 1) / stride + 1
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [ruff] <E731> reported by reviewdog 🐶
Do not assign a lambda expression, use a def

Suggested change
out_padding = lambda i, w, padding, stride, dilation: int(
(i + 2 * padding - dilation * (w - 1) - 1) / stride + 1
)
def out_padding(i, w, padding, stride, dilation):
return int(
(i + 2 * padding - dilation * (w - 1) - 1) / stride + 1
)

Comment on lines +124 to +128
grid_fn = lambda META: (
triton.cdiv(N * od * oh * ow, META['BLOCK_NI_DO_HO_WO']),
triton.cdiv(oc // groups, META['BLOCK_CO']),
groups,
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [ruff] <E731> reported by reviewdog 🐶
Do not assign a lambda expression, use a def

Suggested change
grid_fn = lambda META: (
triton.cdiv(N * od * oh * ow, META['BLOCK_NI_DO_HO_WO']),
triton.cdiv(oc // groups, META['BLOCK_CO']),
groups,
)
def grid_fn(META):
return (
triton.cdiv(N * od * oh * ow, META['BLOCK_NI_DO_HO_WO']),
triton.cdiv(oc // groups, META['BLOCK_CO']),
groups,
)

Comment on lines +10 to +12
padding_same = lambda i, w, stride, dilation: math.ceil(
(stride * (i - 1) + 1 + dilation * (w - 1) - i) / 2
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [ruff] <E731> reported by reviewdog 🐶
Do not assign a lambda expression, use a def

Suggested change
padding_same = lambda i, w, stride, dilation: math.ceil(
(stride * (i - 1) + 1 + dilation * (w - 1) - i) / 2
)
def padding_same(i, w, stride, dilation):
return math.ceil(
(stride * (i - 1) + 1 + dilation * (w - 1) - i) / 2
)

Comment on lines +14 to +16
out_padding = lambda i, w, padding, stride, dilation: int(
(i + 2 * padding - dilation * (w - 1) - 1) / stride + 1
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [ruff] <E731> reported by reviewdog 🐶
Do not assign a lambda expression, use a def

Suggested change
out_padding = lambda i, w, padding, stride, dilation: int(
(i + 2 * padding - dilation * (w - 1) - 1) / stride + 1
)
def out_padding(i, w, padding, stride, dilation):
return int(
(i + 2 * padding - dilation * (w - 1) - 1) / stride + 1
)

Comment on lines +124 to +128
grid_fn = lambda META: (
triton.cdiv(N * od * oh * ow, META['BLOCK_NI_DO_HO_WO']),
triton.cdiv(oc // groups, META['BLOCK_CO']),
groups,
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [ruff] <E731> reported by reviewdog 🐶
Do not assign a lambda expression, use a def

Suggested change
grid_fn = lambda META: (
triton.cdiv(N * od * oh * ow, META['BLOCK_NI_DO_HO_WO']),
triton.cdiv(oc // groups, META['BLOCK_CO']),
groups,
)
def grid_fn(META):
return (
triton.cdiv(N * od * oh * ow, META['BLOCK_NI_DO_HO_WO']),
triton.cdiv(oc // groups, META['BLOCK_CO']),
groups,
)

@azaidy azaidy requested review from azaidy and vgokhale January 22, 2026 15:19
@azaidy azaidy changed the title support.conv3d.triton.kernel [TRITON] support.conv3d.triton.kernel Jan 22, 2026
@vgokhale
Copy link
Contributor

This kernel is the same as the one here

https://github.com/flagos-ai/FlagGems/blob/18bd83adfead48c30d784e961ddad84d514131e4/src/flag_gems/ops/conv3d.py#L114

which has a different license. Also it is not good for our AI libs to have kernels from other companies.

I would suggest closing this PR and writing a conv 3d kernel from scratch. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants