Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
87 commits
Select commit Hold shift + click to select a range
38993f8
Refuse a CUDA graph replay when an input changes shape
shoumikhin Oct 30, 2026
19df317
List the CUDA index shims in the wheel's shared library check
shoumikhin Oct 30, 2026
034d312
Test aoti_torch_get_size
shoumikhin Oct 30, 2026
f52c847
Test more CUDA index shim and CUDA graph cases
shoumikhin Oct 30, 2026
fdbc332
Run a CUDA graph capture call without a graph when the capture fails
shoumikhin Oct 30, 2026
2769a41
Say which dim differs when a CUDA graph replay refuses an input
shoumikhin Oct 30, 2026
1d70dcc
Log an expected CUDA graph capture failure at Info
shoumikhin Oct 30, 2026
cee251b
Record CUDA graph allocations only after the first launch
shoumikhin Oct 30, 2026
757647c
Check the new CUDA graph input shapes in the recapture and replay tests
shoumikhin Oct 30, 2026
a859938
Delete the antialiased resize torch.compile test
shoumikhin Oct 30, 2026
80e7430
Say why the antialiased resize avoids a conditional
shoumikhin Oct 30, 2026
3728b06
Refuse a hand-built data name in AOTI backends that keep data in the …
shoumikhin Oct 30, 2026
c8f0b49
Warn that CUDA data names differing only in case can share a file
shoumikhin Oct 30, 2026
d449899
Correct comments on the CUDA index shims and set_output_data_ptr
shoumikhin Oct 30, 2026
849e5ba
Seed the CUDA random shims from std::random_device
shoumikhin Oct 30, 2026
8c965a1
Run a CUDA method that keeps host state without a graph
shoumikhin Oct 30, 2026
5d280e3
Check the AOTI data name before compiling
shoumikhin Oct 30, 2026
ddb583e
Check delegation and restore deterministic mode in the CUDA index shi…
shoumikhin Oct 30, 2026
5a43778
Fix the CUDA graph capture guard comment
shoumikhin Oct 30, 2026
36b6498
Copy through a boolean mask with where in the CUDA backend
shoumikhin Oct 30, 2026
05ee210
Keep ops with more than 6 dims out of the XNNPACK delegate
shoumikhin Oct 30, 2026
7c53ae1
Merge main into cuda-graph-data-dependent
shoumikhin Oct 30, 2026
24f073c
Drop tensor checks before the CUDA backend compiles a program
shoumikhin Oct 30, 2026
35f3e6e
Test the CUDA masked copy pass and the capture retry end to end
shoumikhin Oct 30, 2026
8ec0a71
Remove a size check only when it tests the index's count
shoumikhin Oct 30, 2026
7429ceb
Say why a CUDA method keeps its graph off for host constants
shoumikhin Oct 30, 2026
3347c9c
Keep destroy() with the other public CUDA backend methods
shoumikhin Oct 30, 2026
c2f0b22
Draw the CUDA RNG seed before allocating its state
shoumikhin Oct 30, 2026
0d88c5b
Format the RemoveAssertAsyncPass import with ufmt
shoumikhin Oct 30, 2026
f65dbb7
Load float64 weights in the CUDA backend
shoumikhin Oct 30, 2026
0674e27
Decompose aten._reshape_copy in the CUDA backend
shoumikhin Oct 30, 2026
339de9b
Add aoti_torch_dtype_float64 to aoti_cuda_shims.lib
shoumikhin Oct 30, 2026
9cc98fc
Retrigger CI
shoumikhin Oct 30, 2026
080ebd4
Add a CUDA shim for scatter_reduce with amax, amin, prod and mean
shoumikhin Oct 30, 2026
f80b75e
Merge main into cuda-graph-data-dependent
shoumikhin Oct 30, 2026
827b3bf
Retrigger CI
shoumikhin Oct 31, 2026
00d75e8
Decompose varlen_attn in the CUDA backend
shoumikhin Oct 31, 2026
f8c08ff
Test the int64 scatter sum in the CUDA backend instead of expecting i…
shoumikhin Oct 31, 2026
3ab0551
Use a model PyTorch 2.14 can export in the CUDA tensor check test
shoumikhin Oct 31, 2026
031f3a2
Check that the CUDA mask tests try a graph capture
shoumikhin Oct 31, 2026
bfb830b
Pin the masked copy pass's integer index and shared picks guards
shoumikhin Oct 31, 2026
cda72ef
Compare masks without recursion in the CUDA masked copy pass
shoumikhin Oct 31, 2026
5d51cdc
Accept float64 in the CUDA shims that still refused it
shoumikhin Oct 31, 2026
7d6c318
Count a scatter mean in the tensor's dtype, as ATen does
shoumikhin Oct 31, 2026
3fffff9
Retry the CUDA random state setup when its seed copy fails
shoumikhin Oct 31, 2026
23dc014
List every exported CUDA shim in the Windows import library
shoumikhin Oct 31, 2026
e26e5c8
Keep buffer updates across calls in AOTI backends with PyTorch 2.14
shoumikhin Oct 31, 2026
99aa24c
Test that the CUDA missing-kernel check sees the scatter fallback
shoumikhin Oct 31, 2026
d232c76
Drop a redundant branch from the masked copy pass and describe what i…
shoumikhin Oct 31, 2026
b643fc3
Read a float64 scalar in the CUDA float64 shim test
shoumikhin Oct 31, 2026
91c2679
Use a scatter the CUDA backend lacks in the missing-kernel test
shoumikhin Oct 31, 2026
5ecc0d2
Return a contiguous output from the CUDA varlen_attn decomposition
shoumikhin Oct 31, 2026
dec7216
Refuse varlen_attn windows on which Flash attention versions differ
shoumikhin Oct 31, 2026
454b40d
Keep NaN values outside the key sequences out of varlen_attn outputs
shoumikhin Oct 31, 2026
0cd2265
Correct the comments on the AOTI folding fix and the scatter kernel test
shoumikhin Oct 31, 2026
d633910
Test the count check guard in the masked copy pass
shoumikhin Oct 31, 2026
1f80332
Correct two comments in the CUDA index shim tests
shoumikhin Oct 31, 2026
800d137
Test a scatter mean count that wraps to zero
shoumikhin Oct 31, 2026
1ba2217
Say the CUDA random state setup failed, not its allocation
shoumikhin Oct 31, 2026
2ec597b
Add the float16 scalar read to the CUDA shims
shoumikhin Oct 31, 2026
aef2dc7
Move the XNNPACK rank check to its own pull request
shoumikhin Oct 31, 2026
c2456b0
Make two varlen_attn decomposition comments exact
shoumikhin Oct 31, 2026
5aa07c3
Say that float accumulation in the CUDA index_put shim can still roun…
shoumikhin Oct 31, 2026
1d3857d
Say what loading CUDA weights waits for in the stream docs
shoumikhin Oct 31, 2026
20a81f3
Index the CUDA mask test with a negative int32 column
shoumikhin Oct 31, 2026
c45a9d4
Say the CUDA scatter_reduce sum loses less to rounding, not nothing
shoumikhin Oct 31, 2026
99a40ca
Drop the unused libgomp dependency from CUDA backend programs
shoumikhin Oct 31, 2026
da49efb
Keep keys past the end out of the CUDA Triton SDPA softmax
shoumikhin Oct 31, 2026
17517cf
Remove the CUDA backend's temporary library when a load fails
shoumikhin Oct 31, 2026
7ad215f
Point the CUDA backend's libgomp TODO at the PyTorch fix
shoumikhin Oct 31, 2026
1391e97
Add a CUDA shim for scatter with a tensor source
shoumikhin Oct 31, 2026
c89e8e6
Let the CUDA scatter shims read an int32 index
shoumikhin Oct 31, 2026
598da8d
Write each element once in the CUDA scatter shim
shoumikhin Oct 31, 2026
3cde5e7
Name the calling CUDA scatter shim in its errors
shoumikhin Oct 31, 2026
94b46b7
Say which ATen kernel the CUDA scatter bounds check matches
shoumikhin Oct 31, 2026
cfd88fa
Run a CUDA graph capture that reads a device value without a graph
shoumikhin Nov 1, 2026
b1bd8a5
Rewrite masked copies inside torch.cond branches too
shoumikhin Nov 1, 2026
d25067c
Keep the CUDA compile patches in place while any thread lowers
shoumikhin Nov 1, 2026
47b36b4
Pass a float read with .item() to Triton kernels as a float
shoumikhin Nov 1, 2026
2521522
Say the AOTI folding switch covers the whole program
shoumikhin Nov 1, 2026
74785e0
Test the CUDA scatter shims on more layouts, dtypes and edge cases
shoumikhin Nov 1, 2026
d19e2b7
Run the varlen_attn and _reshape_copy programs in the CUDA tests
shoumikhin Nov 1, 2026
0e2f8b8
Keep PyTorch's internal test helpers out of the CUDA index shim tests
shoumikhin Nov 1, 2026
7a2df0a
Assign the CUDA compile patches explicitly
shoumikhin Nov 1, 2026
4f1eccb
Test that the masked copy pass keeps two random masks apart
shoumikhin Nov 1, 2026
1ce2692
Check that a failed CUDA graph capture is tried only once
shoumikhin Nov 1, 2026
bdea161
Lower the _reshape_copy and varlen_attn programs on ROCm again
shoumikhin Nov 1, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .ci/scripts/wheel/test_shared_libraries.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,10 @@
"aoti_torch_cuda_randint_low_out",
"aoti_torch_cuda_sort_stable",
"aoti_torch_cuda_guard_set_index",
"aoti_torch_cuda_index_Tensor",
"aoti_torch_index_put_out",
"aoti_torch_cuda_scatter_reduce_two_out",
"aoti_torch_cuda_scatter_src_out",
)

_QUANTIZED_KERNEL_SYMBOLS = (
Expand Down
41 changes: 31 additions & 10 deletions backends/aoti/aoti_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,22 @@ def _checked_data_name(data_name: str) -> str:
return data_name


def _written_buffer_options(program: ExportedProgram) -> Dict[str, Any]:
"""Inductor options for a program that writes a buffer.

They turn off Inductor's joint-graph constant folding for the whole
program, not only for the buffers it writes. Before torch 2.15, that
folding can turn the update of a one-element buffer, such as a counter,
into its value at export, so every call writes that same value
(https://github.com/pytorch/pytorch/pull/185077).

TODO: remove once the pinned torch is 2.15 or newer.
"""
if program.graph_signature.buffers_to_mutate:
return {"joint_graph_constant_folding": False}
return {}


@experimental(
"This API and all of aoti-driven backend related functionality are experimental."
)
Expand Down Expand Up @@ -286,9 +302,13 @@ def preprocess(
Preprocess the edge program and compile it using AOTInductor.
Weights are always separated from the SO file.
"""
# First, so that a backend keeping its data in the .pte refuses a data
# name before anything is compiled.
data_name = cls.data_name_from_compile_specs(compile_specs)
device_name = cls.get_device_name()
decomposition_table = cls.get_decomposition_table()
options = cls.get_aoti_compile_options(compile_specs)
options.update(_written_buffer_options(edge_program))

# Move the edge_program to the target device. Routed through a hook so
# backends can keep large non-parameter tensors (e.g. KV-cache buffers)
Expand Down Expand Up @@ -390,11 +410,7 @@ def preprocess(
named_data_store.add_named_data(so_blob_key, so_data, 1, None)
# Determine whether to save named data externally based on backend setting
# External: save to separate .ptd file, otherwise merge with .pte file
external_tag = (
cls.data_name_from_compile_specs(compile_specs)
if cls.save_data_externally()
else None
)
external_tag = data_name if cls.save_data_externally() else None

named_data_store.add_named_data(weights_blob_key, blob_data, 1, external_tag)

Expand Down Expand Up @@ -435,11 +451,7 @@ def generate_data_name_compile_spec(cls, data_name: str) -> CompileSpec:
Generate a CompileSpec that names the external data file, written as
``<data_name>.ptd``, so several programs can share a folder.
"""
if not cls.save_data_externally():
raise ValueError(
f"{cls.__name__} keeps its data in the .pte file, so it takes no "
"data name"
)
cls._check_saves_data_externally()
return CompileSpec(
COMPILE_SPEC_KEYS.DATA_NAME.value,
_checked_data_name(data_name).encode("utf-8"),
Expand All @@ -453,9 +465,18 @@ def data_name_from_compile_specs(cls, compile_specs: List[CompileSpec]) -> str:
"""
for spec in compile_specs:
if spec.key == COMPILE_SPEC_KEYS.DATA_NAME.value:
cls._check_saves_data_externally()
return _checked_data_name(spec.value.decode("utf-8"))
return f"aoti_{cls.get_device_name()}_blob"

@classmethod
def _check_saves_data_externally(cls) -> None:
if not cls.save_data_externally():
raise ValueError(
f"{cls.__name__} keeps its data in the .pte file, so it takes no "
"data name"
)

@classmethod
def method_name_from_compile_specs(
cls,
Expand Down
4 changes: 4 additions & 0 deletions backends/aoti/common_shims_slim.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,10 @@ int32_t aoti_torch_dtype_float32() {
return 6; // ScalarType::Float
}

int32_t aoti_torch_dtype_float64() {
return 7; // ScalarType::Double
}

int32_t aoti_torch_dtype_bfloat16() {
return 15; // ScalarType::BFloat16
}
Expand Down
1 change: 1 addition & 0 deletions backends/aoti/common_shims_slim.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ aoti_torch_get_device_index(Tensor* tensor, int32_t* ret_device_index);
// ============================================================

AOTI_SHIM_EXPORT int32_t aoti_torch_dtype_float32();
AOTI_SHIM_EXPORT int32_t aoti_torch_dtype_float64();
AOTI_SHIM_EXPORT int32_t aoti_torch_dtype_bfloat16();
AOTI_SHIM_EXPORT int32_t aoti_torch_dtype_float16();
AOTI_SHIM_EXPORT int32_t aoti_torch_dtype_int64();
Expand Down
14 changes: 11 additions & 3 deletions backends/aoti/slim/c10/core/ScalarType.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,14 @@
#include <ostream>

#include <executorch/runtime/core/portable_type/bfloat16.h>
#include <executorch/runtime/core/portable_type/half.h>
#include <executorch/runtime/platform/assert.h>

namespace executorch::backends::aoti::slim::c10 {

// Import BFloat16 from ExecuTorch's portable_type
// Import BFloat16 and Half from ExecuTorch's portable_type
using BFloat16 = ::executorch::runtime::etensor::BFloat16;
using Half = ::executorch::runtime::etensor::Half;

/// Enum representing the scalar type (dtype) of tensor elements.
/// Note: Enum values must match PyTorch's c10::ScalarType for compatibility.
Expand All @@ -30,7 +32,7 @@ enum class ScalarType : int8_t {
Long = 4, // int64_t
Half = 5, // float16
Float = 6, // float
// Double = 7, // double - not currently needed
Double = 7, // double
// ComplexHalf = 8,
// ComplexFloat = 9,
// ComplexDouble = 10,
Expand All @@ -50,6 +52,7 @@ constexpr ScalarType kInt = ScalarType::Int;
constexpr ScalarType kLong = ScalarType::Long;
constexpr ScalarType kHalf = ScalarType::Half;
constexpr ScalarType kFloat = ScalarType::Float;
constexpr ScalarType kDouble = ScalarType::Double;
constexpr ScalarType kBool = ScalarType::Bool;
constexpr ScalarType kBFloat16 = ScalarType::BFloat16;

Expand All @@ -72,6 +75,8 @@ inline size_t elementSize(ScalarType t) {
return 2; // sizeof(__half) = 2 bytes
case ScalarType::Float:
return sizeof(float);
case ScalarType::Double:
return sizeof(double);
case ScalarType::Bool:
return sizeof(bool);
case ScalarType::BFloat16:
Expand Down Expand Up @@ -100,6 +105,8 @@ inline const char* toString(ScalarType t) {
return "Half";
case ScalarType::Float:
return "Float";
case ScalarType::Double:
return "Double";
case ScalarType::Bool:
return "Bool";
case ScalarType::BFloat16:
Expand All @@ -116,7 +123,7 @@ inline const char* toString(ScalarType t) {
/// @return true if the scalar type is floating point, false otherwise.
inline bool isFloatingType(ScalarType t) {
return t == ScalarType::Half || t == ScalarType::Float ||
t == ScalarType::BFloat16;
t == ScalarType::Double || t == ScalarType::BFloat16;
}

/// Checks if the scalar type is an integral type (including bool optionally).
Expand Down Expand Up @@ -157,6 +164,7 @@ inline bool isValidScalarType(ScalarType t) {
case ScalarType::Long:
case ScalarType::Half:
case ScalarType::Float:
case ScalarType::Double:
case ScalarType::Bool:
case ScalarType::BFloat16:
return true;
Expand Down
2 changes: 2 additions & 0 deletions backends/aoti/slim/c10/core/test/test_scalar_type.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ const std::vector<ScalarTypeTestData> kAllScalarTypes = {
{ScalarType::Long, 4, 8, "Long", false, true, true, false},
{ScalarType::Half, 5, 2, "Half", true, false, false, false},
{ScalarType::Float, 6, 4, "Float", true, false, false, false},
{ScalarType::Double, 7, 8, "Double", true, false, false, false},
{ScalarType::Bool, 11, 1, "Bool", false, false, true, true},
{ScalarType::BFloat16, 15, 2, "BFloat16", true, false, false, false},
};
Expand Down Expand Up @@ -224,6 +225,7 @@ TEST_F(IsValidScalarTypeTest, AllSupportedTypesAreValid) {
EXPECT_TRUE(isValidScalarType(ScalarType::Long));
EXPECT_TRUE(isValidScalarType(ScalarType::Half));
EXPECT_TRUE(isValidScalarType(ScalarType::Float));
EXPECT_TRUE(isValidScalarType(ScalarType::Double));
EXPECT_TRUE(isValidScalarType(ScalarType::Bool));
EXPECT_TRUE(isValidScalarType(ScalarType::BFloat16));
}
Expand Down
6 changes: 3 additions & 3 deletions backends/aoti/slim/core/test/test_slimtensor_basic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -508,18 +508,18 @@ TEST(SlimTensorValidationTest, InvalidDtypeUndefined) {
"");
}

TEST(SlimTensorValidationTest, InvalidDtypeDouble) {
TEST(SlimTensorValidationTest, InvalidDtypeComplexFloat) {
std::vector<int64_t> sizes = {2, 3};
std::vector<int64_t> strides = {3, 1};
size_t nbytes = 6 * sizeof(double);
size_t nbytes = 6 * 2 * sizeof(float);
Storage storage = make_cpu_storage(nbytes);

EXPECT_DEATH(
SlimTensor(
std::move(storage),
makeArrayRef(sizes),
makeArrayRef(strides),
static_cast<c10::ScalarType>(7)), // Double = 7
static_cast<c10::ScalarType>(9)), // ComplexFloat = 9
"");
}

Expand Down
8 changes: 4 additions & 4 deletions backends/aoti/slim/factory/test/test_empty.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -249,15 +249,15 @@ TEST(EmptyStridedTest, InvalidDtypeUndefined) {
"");
}

TEST(EmptyStridedTest, InvalidDtypeDouble) {
TEST(EmptyStridedTest, InvalidDtypeComplexFloat) {
std::vector<int64_t> sizes = {2, 3};
std::vector<int64_t> strides = {3, 1};

EXPECT_DEATH(
empty_strided(
makeArrayRef(sizes),
makeArrayRef(strides),
static_cast<c10::ScalarType>(7)), // Double = 7
static_cast<c10::ScalarType>(9)), // ComplexFloat = 9
"");
}

Expand All @@ -280,9 +280,9 @@ TEST(EmptyTest, InvalidDtypeUndefined) {
EXPECT_DEATH(empty({2, 3}, c10::ScalarType::Undefined), "");
}

TEST(EmptyTest, InvalidDtypeDouble) {
TEST(EmptyTest, InvalidDtypeComplexFloat) {
EXPECT_DEATH(
empty({2, 3}, static_cast<c10::ScalarType>(7)), // Double = 7
empty({2, 3}, static_cast<c10::ScalarType>(9)), // ComplexFloat = 9
"");
}

Expand Down
4 changes: 2 additions & 2 deletions backends/aoti/slim/factory/test/test_from_blob.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -327,12 +327,12 @@ TEST(FromBlobTest, InvalidDtypeUndefined) {
from_blob(external_data, {2, 3}, c10::ScalarType::Undefined), "");
}

TEST(FromBlobTest, InvalidDtypeDouble) {
TEST(FromBlobTest, InvalidDtypeComplexFloat) {
constexpr size_t kNumFloats = 6;
float external_data[kNumFloats];

EXPECT_DEATH(
from_blob(external_data, {2, 3}, static_cast<c10::ScalarType>(7)), "");
from_blob(external_data, {2, 3}, static_cast<c10::ScalarType>(9)), "");
}

TEST(FromBlobTest, InvalidDeviceType) {
Expand Down
36 changes: 36 additions & 0 deletions backends/aoti/tests/test_common_shims_slim.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,28 @@ void runGetSizesTest(slim_c10::DeviceType device_type) {
delete tensor;
}

void runGetSizeTest(slim_c10::DeviceType device_type) {
std::vector<int64_t> sizes = {2, 3};
std::vector<int64_t> strides = calculateContiguousStrides(sizes);
slim_c10::Device device(device_type, 0);

Tensor* tensor = new Tensor(slim::empty_strided(
slim::makeArrayRef(sizes),
slim::makeArrayRef(strides),
slim_c10::ScalarType::Float,
device));

int64_t size = -1;
EXPECT_EQ(aoti_torch_get_size(tensor, 1, &size), Error::Ok);
EXPECT_EQ(size, 3);
EXPECT_EQ(aoti_torch_get_size(tensor, -2, &size), Error::Ok);
EXPECT_EQ(size, 2);
EXPECT_EQ(aoti_torch_get_size(tensor, 2, &size), Error::InvalidArgument);
EXPECT_EQ(aoti_torch_get_size(tensor, -3, &size), Error::InvalidArgument);

delete tensor;
}

void runGetStridesTest(slim_c10::DeviceType device_type) {
std::vector<int64_t> sizes = {2, 3, 4};
std::vector<int64_t> strides = calculateContiguousStrides(sizes);
Expand Down Expand Up @@ -432,6 +454,10 @@ TEST_F(CommonShimsSlimTest, GetSizes_CPU) {
runGetSizesTest(slim_c10::DeviceType::CPU);
}

TEST_F(CommonShimsSlimTest, GetSize_CPU) {
runGetSizeTest(slim_c10::DeviceType::CPU);
}

TEST_F(CommonShimsSlimTest, GetStrides_CPU) {
runGetStridesTest(slim_c10::DeviceType::CPU);
}
Expand Down Expand Up @@ -483,6 +509,13 @@ TEST_F(CommonShimsSlimTest, GetSizes_CUDA) {
runGetSizesTest(slim_c10::DeviceType::CUDA);
}

TEST_F(CommonShimsSlimTest, GetSize_CUDA) {
if (!isCudaAvailable()) {
GTEST_SKIP() << "CUDA not available";
}
runGetSizeTest(slim_c10::DeviceType::CUDA);
}

TEST_F(CommonShimsSlimTest, GetStrides_CUDA) {
if (!isCudaAvailable()) {
GTEST_SKIP() << "CUDA not available";
Expand Down Expand Up @@ -555,6 +588,7 @@ TEST_F(CommonShimsSlimTest, NullTensorArgument) {
EXPECT_EQ(
aoti_torch_get_data_ptr(nullptr, &data_ptr), Error::InvalidArgument);
EXPECT_EQ(aoti_torch_get_sizes(nullptr, &sizes), Error::InvalidArgument);
EXPECT_EQ(aoti_torch_get_size(nullptr, 0, &numel), Error::InvalidArgument);
EXPECT_EQ(aoti_torch_get_strides(nullptr, &strides), Error::InvalidArgument);
EXPECT_EQ(aoti_torch_get_dtype(nullptr, &dtype), Error::InvalidArgument);
EXPECT_EQ(aoti_torch_get_dim(nullptr, &dim), Error::InvalidArgument);
Expand All @@ -566,6 +600,7 @@ TEST_F(CommonShimsSlimTest, NullReturnPointer) {

EXPECT_EQ(aoti_torch_get_data_ptr(tensor, nullptr), Error::InvalidArgument);
EXPECT_EQ(aoti_torch_get_sizes(tensor, nullptr), Error::InvalidArgument);
EXPECT_EQ(aoti_torch_get_size(tensor, 0, nullptr), Error::InvalidArgument);
EXPECT_EQ(aoti_torch_get_strides(tensor, nullptr), Error::InvalidArgument);
EXPECT_EQ(aoti_torch_get_dtype(tensor, nullptr), Error::InvalidArgument);
EXPECT_EQ(aoti_torch_get_dim(tensor, nullptr), Error::InvalidArgument);
Expand Down Expand Up @@ -663,6 +698,7 @@ TEST_F(CommonShimsSlimTest, ConsistentPointerReturn) {
TEST_F(CommonShimsSlimTest, DTypeConstants) {
// Verify dtype constants match expected PyTorch ScalarType values
EXPECT_EQ(aoti_torch_dtype_float32(), 6); // ScalarType::Float
EXPECT_EQ(aoti_torch_dtype_float64(), 7); // ScalarType::Double
EXPECT_EQ(aoti_torch_dtype_bfloat16(), 15); // ScalarType::BFloat16
EXPECT_EQ(aoti_torch_dtype_int64(), 4); // ScalarType::Long
EXPECT_EQ(aoti_torch_dtype_int32(), 3); // ScalarType::Int
Expand Down
2 changes: 2 additions & 0 deletions backends/cuda/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,9 @@ fbcode_target(
"passes/__init__.py",
"passes/move_cond_predicate_to_cpu.py",
"passes/lower_offgraph_kv.py",
"passes/remove_assert_async.py",
"passes/replace_int64_floordiv.py",
"passes/replace_masked_copy_with_where.py",
],
visibility = [
"//executorch/backends/cuda/...",
Expand Down
Loading
Loading