Repository navigation
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/184412
Note: Links to docs will display an error until the docs builds have been completed. ❌ 1 New Failure, 1 Unrelated FailureAs of commit 92f2aa0 with merge base 2aa7215 ( NEW FAILURE - The following job has failed:
UNSTABLE - The following job is marked as unstable, possibly due to flakiness on trunk:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
The `_T` TypeVar was declared with `bound=_KernelType`, where `_KernelType` is a `CompiledKernel | StaticallyLaunchedCudaKernel | StaticallyLaunchedXpuKernel` union. A union bound doesn't give a TypeVar any real constraining power; the spec-correct form for "exactly one of these three" is a constrained TypeVar (positional arguments). Switch to that, keep `_KernelType` as an explicit `TypeAlias` for the few sites that genuinely want the union (return types, local annotations), and pin the two definitions together with an import-time assert so they can't silently drift. The three aggregate `CompileResult[_KernelType]` sites become `CompileResult[Any]` since a constrained TypeVar can't be parameterized with the union itself. Fixes #184159 Authored by Claude ghstack-source-id: cf43a51 Pull-Request: #184412
Skylion007
left a comment
There was a problem hiding this comment.
I don't get why they can't be parameteized with a Union
|
|
||
| def _make_launcher( | ||
| self, compile_result: CompileResult[_KernelType] | ||
| self, compile_result: CompileResult[Any] |
There was a problem hiding this comment.
Feel like there should be able to be something more specific used than Any here.
The `_T` TypeVar was declared with `bound=_KernelType`, where `_KernelType` is a `CompiledKernel | StaticallyLaunchedCudaKernel | StaticallyLaunchedXpuKernel` union. A union bound doesn't give a TypeVar any real constraining power; the spec-correct form for "exactly one of these three" is a constrained TypeVar (positional arguments). Switch to that, keep `_KernelType` as an explicit `TypeAlias` for the few sites that genuinely want the union (return types, local annotations), and pin the two definitions together with an import-time assert so they can't silently drift. The three aggregate `CompileResult[_KernelType]` sites become `CompileResult[Any]` since a constrained TypeVar can't be parameterized with the union itself. Fixes #184159 Authored by Claude ghstack-source-id: fb3e03b Pull-Request: #184412
|
@pytorchbot merge |
Merge startedYour 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 |
Merge failedReason: 1 jobs have failed, first few of them are: trunk / linux-jammy-rocm-py3.10-mi355 / test (distributed, 1, 4, linux.rocm.gpu.gfx950.2) Details for Dev Infra teamRaised by workflow job |
|
@claude explain those CI failures, are they related? |
|
Claude finished @jansel's task in 26s —— View job
CI Failure AnalysisNo, the CI failures are not related to this PR. The single failure ( The CI runner's IAM role ( The cancelled job ( TL;DR: Infrastructure issue with ROCm CI runners' S3 permissions. Safe to retry or override. |
|
@pytorchbot merge -i |
Merge startedYour change will be merged while ignoring the following 2 checks: trunk / linux-jammy-rocm-py3.10-mi355 / test (distributed, 1, 4, linux.rocm.gpu.gfx950.2), trunk / linux-jammy-rocm-py3.10-mi355 / test (default, 3, 10, linux.rocm.gpu.gfx950.1) Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
The `_T` TypeVar was declared with `bound=_KernelType`, where `_KernelType` is a `CompiledKernel | StaticallyLaunchedCudaKernel | StaticallyLaunchedXpuKernel` union. A union bound doesn't give a TypeVar any real constraining power; the spec-correct form for "exactly one of these three" is a constrained TypeVar (positional arguments). Switch to that, keep `_KernelType` as an explicit `TypeAlias` for the few sites that genuinely want the union (return types, local annotations), and pin the two definitions together with an import-time assert so they can't silently drift. The three aggregate `CompileResult[_KernelType]` sites become `CompileResult[Any]` since a constrained TypeVar can't be parameterized with the union itself. Fixes #184159 Authored by Claude Pull Request resolved: #184412 Approved by: https://github.com/jansel, https://github.com/Skylion007
The `_T` TypeVar was declared with `bound=_KernelType`, where `_KernelType` is a `CompiledKernel | StaticallyLaunchedCudaKernel | StaticallyLaunchedXpuKernel` union. A union bound doesn't give a TypeVar any real constraining power; the spec-correct form for "exactly one of these three" is a constrained TypeVar (positional arguments). Switch to that, keep `_KernelType` as an explicit `TypeAlias` for the few sites that genuinely want the union (return types, local annotations), and pin the two definitions together with an import-time assert so they can't silently drift. The three aggregate `CompileResult[_KernelType]` sites become `CompileResult[Any]` since a constrained TypeVar can't be parameterized with the union itself. Fixes pytorch#184159 Authored by Claude Pull Request resolved: pytorch#184412 Approved by: https://github.com/jansel, https://github.com/Skylion007
The `_T` TypeVar was declared with `bound=_KernelType`, where `_KernelType` is a `CompiledKernel | StaticallyLaunchedCudaKernel | StaticallyLaunchedXpuKernel` union. A union bound doesn't give a TypeVar any real constraining power; the spec-correct form for "exactly one of these three" is a constrained TypeVar (positional arguments). Switch to that, keep `_KernelType` as an explicit `TypeAlias` for the few sites that genuinely want the union (return types, local annotations), and pin the two definitions together with an import-time assert so they can't silently drift. The three aggregate `CompileResult[_KernelType]` sites become `CompileResult[Any]` since a constrained TypeVar can't be parameterized with the union itself. Fixes pytorch#184159 Authored by Claude Pull Request resolved: pytorch#184412 Approved by: https://github.com/jansel, https://github.com/Skylion007
The `_T` TypeVar was declared with `bound=_KernelType`, where `_KernelType` is a `CompiledKernel | StaticallyLaunchedCudaKernel | StaticallyLaunchedXpuKernel` union. A union bound doesn't give a TypeVar any real constraining power; the spec-correct form for "exactly one of these three" is a constrained TypeVar (positional arguments). Switch to that, keep `_KernelType` as an explicit `TypeAlias` for the few sites that genuinely want the union (return types, local annotations), and pin the two definitions together with an import-time assert so they can't silently drift. The three aggregate `CompileResult[_KernelType]` sites become `CompileResult[Any]` since a constrained TypeVar can't be parameterized with the union itself. Fixes pytorch#184159 Authored by Claude Pull Request resolved: pytorch#184412 Approved by: https://github.com/jansel, https://github.com/Skylion007
Stack from ghstack (oldest at bottom):
The
_TTypeVar was declared withbound=_KernelType, where_KernelTypeis aCompiledKernel | StaticallyLaunchedCudaKernel | StaticallyLaunchedXpuKernelunion.A union bound doesn't give a TypeVar any real constraining power; the spec-correct form for "exactly one of these three" is a constrained TypeVar (positional arguments).
Switch to that, keep
_KernelTypeas an explicitTypeAliasfor the few sites that genuinely want the union (return types, local annotations), and pin the two definitions together with an import-time assert so they can't silently drift.The three aggregate
CompileResult[_KernelType]sites becomeCompileResult[Any]since a constrained TypeVar can't be parameterized with the union itself.Fixes #184159
Authored by Claude
cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @ipiszy @kadeng @muchulee8 @amjames @chauhang @aakhundov @coconutruben @jataylo