Skip to content

[BE] Cleanup upsample_ kernel dispatch#176422

Closed
NicolasHug wants to merge 12 commits intopytorch:mainfrom
NicolasHug:upsample_cosmetics
Closed

[BE] Cleanup upsample_ kernel dispatch#176422
NicolasHug wants to merge 12 commits intopytorch:mainfrom
NicolasHug:upsample_cosmetics

Conversation

@NicolasHug
Copy link
Member

@NicolasHug NicolasHug commented Mar 4, 2026

This is a cleanup for 4 functions: upsample_bilinear2d_aa_kernel_impl, upsample_bilinear2d_kernel_impl, upsample_bicubic2d_aa_kernel_impl, and upsample_bicubic2d_kernel_impl. They all follow the same dispatch logic but were previously implementing that logic in slightly different ways, and had duplicated calls (to e.g. separable_upsample_generic_Nd_kernel_impl).

This PR unifies and simplifies the logic which now looks like this for all 4 functions:

if dtype == uint8:
	if AVX2 and ...:
		return avx2_path(...)
    elif aarch64 and ...:
        return neon_path(...)
else:
	return generic_path(...)

cc @jgong5 @mingfeima @XiaobingSuper @sanchitintel @ashokei @jingxu10 @jerryzh168 @aditew01

@NicolasHug NicolasHug added the topic: not user facing topic category label Mar 4, 2026
@pytorch-bot
Copy link

pytorch-bot bot commented Mar 4, 2026

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/176422

Note: Links to docs will display an error until the docs builds have been completed.

✅ No Failures

As of commit 2fa4440 with merge base 14f828c (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@pytorch-bot pytorch-bot bot added the module: cpu CPU specific problem (e.g., perf, algorithm) label Mar 4, 2026
@NicolasHug NicolasHug marked this pull request as draft March 4, 2026 11:12
@NicolasHug NicolasHug marked this pull request as ready for review March 4, 2026 12:37
@NicolasHug
Copy link
Member Author

@pytorchbot merge

@pytorch-bot pytorch-bot bot added the ciflow/trunk Trigger trunk jobs on your pull request label Mar 4, 2026
@pytorchmergebot
Copy link
Collaborator

Merge started

Your change will be merged once all checks pass (ETA 0-4 Hours).

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

@pytorchmergebot
Copy link
Collaborator

Merge failed

Reason: 1 jobs have failed, first few of them are: linux-aarch64 / linux-jammy-aarch64-py3.10 / test (openreg, 1, 1, lf.linux.arm64.m7g.4xlarge)

Details for Dev Infra team Raised by workflow job

@NicolasHug
Copy link
Member Author

@pytorchbot merge

@pytorchmergebot
Copy link
Collaborator

Merge started

Your change will be merged once all checks pass (ETA 0-4 Hours).

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

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

Labels

ciflow/trunk Trigger trunk jobs on your pull request Merged module: cpu CPU specific problem (e.g., perf, algorithm) topic: not user facing topic category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants