Repository navigation
Expand file tree
/
Copy path_causal_conv1d_arch.py
More file actions
55 lines (42 loc) · 1.64 KB
/
Copy path_causal_conv1d_arch.py
File metadata and controls
55 lines (42 loc) · 1.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
"""Internal functional and schedule policy for the causal-convolution family."""
FUNCTIONAL_COMPUTE_CAPABILITIES = frozenset(
{
(8, 0),
(8, 6),
(8, 7),
(8, 9),
(9, 0),
(10, 0),
(10, 3),
(11, 0),
(12, 0),
(12, 1),
}
)
F32X2_COMPUTE_CAPABILITIES = frozenset(
{
(10, 0),
(10, 3),
(11, 0),
(12, 0),
(12, 1),
}
)
# The update route currently admits the same functional targets as the bulk
# route. Keep this semantic alias so diagnostics remain operation-specific even
# if the two implementations diverge later.
SUPPORTED_CAUSAL_CONV1D_UPDATE_COMPUTE_CAPABILITIES = FUNCTIONAL_COMPUTE_CAPABILITIES
def is_functional_arch(compute_capability: tuple[int, int]) -> bool:
return compute_capability in FUNCTIONAL_COMPUTE_CAPABILITIES
def uses_vec8_schedule(compute_capability: tuple[int, int], n_channels: int) -> bool:
return compute_capability in F32X2_COMPUTE_CAPABILITIES and n_channels % 8 == 0
def is_supported_causal_conv1d_update_compute_capability(
compute_capability: tuple[int, int],
) -> bool:
"""Return whether the operation admits this functional target."""
return is_functional_arch(compute_capability)
def supported_causal_conv1d_update_compute_capabilities_text() -> str:
"""Return the functional allowlist in a stable diagnostic format."""
return ", ".join(f"{major}.{minor}" for major, minor in sorted(SUPPORTED_CAUSAL_CONV1D_UPDATE_COMPUTE_CAPABILITIES))