← Back to Leaderboard

The AI CUDA Engineer 👷

99_TripletMarginLosshybrid_reduction_triplet_loss_base

Level 1 • Task 99
import torch
import torch.nn as nn
import torch.nn.functional as F


def module_fn(
    anchor: torch.Tensor, positive: torch.Tensor, negative: torch.Tensor, margin: float
) -> torch.Tensor:
    """
    Computes the Triplet Margin Loss for metric learning tasks.

    Args:
        anchor (torch.Tensor): Anchor values.
        positive (torch.Tensor): Positive values.
        negative (torch.Tensor): Negative values.
        margin (float): Margin value.

    Returns:
        torch.Tensor: Triplet Margin Loss.
    """
    return F.triplet_margin_loss(anchor, positive, negative, margin=margin)


class Model(nn.Module):
    """
    A model that computes Triplet Margin Loss for metric learning tasks.
    """

    def __init__(self, margin):
        super(Model, self).__init__()
        self.margin = margin

    def forward(self, anchor, positive, negative, fn=module_fn):
        return fn(anchor, positive, negative, self.margin)


batch_size = 128
input_shape = (4096,)
dim = 1
margin = 1.0


def get_inputs():
    return [
        torch.randn(batch_size, *input_shape),
        torch.randn(batch_size, *input_shape),
        torch.randn(batch_size, *input_shape),
    ]


def get_init_inputs():
    return [margin]
import torch
import torch.nn as nn

class Model(nn.Module):
    """
    A model that computes Triplet Margin Loss for metric learning tasks.

    Parameters:
        margin (float): The margin between the positive and negative samples.
    """
    def __init__(self, margin=1.0):
        super(Model, self).__init__()
        self.loss_fn = torch.nn.TripletMarginLoss(margin=margin)

    def forward(self, anchor, positive, negative):
        return self.loss_fn(anchor, positive, negative)

batch_size = 128
input_shape = (4096, )
dim = 1

def get_inputs():
    return [torch.randn(batch_size, *input_shape), torch.randn(batch_size, *input_shape), torch.randn(batch_size, *input_shape)]

def get_init_inputs():
    return [1.0]  # Default margin

Kernel Information

Related Kernels (Level 1, Task 99 • 99_TripletMarginLoss)

#include <torch/extension.h>
#include <cuda.h>
#include <cuda_runtime.h>

template <typename scalar_t>
__global__ void hybrid_triplet_margin_loss_kernel(
    const scalar_t* __restrict__ anchor,
    const scalar_t* __restrict__ positive,
    const scalar_t* __restrict__ negative,
    scalar_t* __restrict__ output,
    const float margin,
    const int batch_size,
    const int feat_size) {
    
    extern __shared__ char shared_memory[];
    scalar_t* shared_pos = (scalar_t*)shared_memory;
    scalar_t* shared_neg = shared_pos + blockDim.x;
    
    const int tid = threadIdx.x;
    const int bid = blockIdx.x;
    const int warp_id = tid / warpSize;
    const int lane_id = tid % warpSize;
    const int grid_stride = gridDim.x * blockDim.x;
    
    // Initialize accumulators
    scalar_t sum_pos = 0;
    scalar_t sum_neg = 0;
    
    // Grid-stride loop for coalesced memory access
    for (int idx = bid * blockDim.x + tid; idx < batch_size * feat_size; idx += grid_stride) {
        const int b = idx / feat_size;
        const int f = idx % feat_size;
        if (b < batch_size && f < feat_size) {
            const scalar_t a = anchor[idx];
            const scalar_t p = positive[idx];
            const scalar_t n = negative[idx];
            
            const scalar_t dp = a - p;
            const scalar_t dn = a - n;
            sum_pos += dp * dp;
            sum_neg += dn * dn;
        }
    }
    
    // First level reduction: within warp using shuffle
    #pragma unroll
    for (int offset = warpSize/2; offset > 0; offset /= 2) {
        sum_pos += __shfl_down_sync(0xffffffff, sum_pos, offset);
        sum_neg += __shfl_down_sync(0xffffffff, sum_neg, offset);
    }
    
    // Write warp results to shared memory
    if (lane_id == 0) {
        shared_pos[warp_id] = sum_pos;
        shared_neg[warp_id] = sum_neg;
    }
    __syncthreads();
    
    // Second level reduction: across warps using the first warp
    const int num_warps = (blockDim.x + warpSize - 1) / warpSize;
    if (warp_id == 0 && lane_id < num_warps) {
        sum_pos = shared_pos[lane_id];
        sum_neg = shared_neg[lane_id];
        
        // Final warp reduction
        #pragma unroll
        for (int offset = num_warps/2; offset > 0; offset /= 2) {
            sum_pos += __shfl_down_sync(0xffffffff, sum_pos, offset);
            sum_neg += __shfl_down_sync(0xffffffff, sum_neg, offset);
        }
        
        // Write final block result
        if (lane_id == 0) {
            const int batch_idx = bid;
            if (batch_idx < batch_size) {
                const scalar_t dist_pos = sqrt(sum_pos);
                const scalar_t dist_neg = sqrt(sum_neg);
                output[batch_idx] = max(scalar_t(0.0), dist_pos - dist_neg + margin);
            }
        }
    }
}

torch::Tensor hybrid_triplet_margin_loss_cuda(
    torch::Tensor anchor,
    torch::Tensor positive,
    torch::Tensor negative,
    float margin) {
    
    TORCH_CHECK(anchor.device().is_cuda(), "anchor must be a CUDA tensor");
    TORCH_CHECK(positive.device().is_cuda(), "positive must be a CUDA tensor");
    TORCH_CHECK(negative.device().is_cuda(), "negative must be a CUDA tensor");
    
    const int batch_size = anchor.size(0);
    const int feat_size = anchor.size(1);
    
    // Configure kernel launch parameters
    const int threads_per_block = 256;
    const int blocks = min(batch_size, 1024); // Limit max blocks for better occupancy
    
    auto output = torch::zeros({batch_size}, anchor.options());
    
    // Calculate shared memory size
    const int shared_mem_size = 2 * threads_per_block * sizeof(float);
    
    AT_DISPATCH_FLOATING_TYPES(anchor.scalar_type(), "hybrid_triplet_margin_loss_kernel", ([&] {
        hybrid_triplet_margin_loss_kernel<scalar_t><<<blocks, threads_per_block, shared_mem_size>>>(
            anchor.data_ptr<scalar_t>(),
            positive.data_ptr<scalar_t>(),
            negative.data_ptr<scalar_t>(),
            output.data_ptr<scalar_t>(),
            margin,
            batch_size,
            feat_size);
    }));
    
    return output.mean();
}

PYBIND11_MODULE(TORCH_EXTENSION_NAME, m) {
    m.def("forward", &hybrid_triplet_margin_loss_cuda, "Hybrid Triplet Margin Loss forward (CUDA)");
}
Performance Metrics
Metric Value Unit Variance Samples
Executed Ipc Active 0.566 inst/cycle 0.000 5
Executed Ipc Elapsed 0.384 inst/cycle 0.000 5
Issue Slots Busy 14.334 % 0.040 5
Issued Ipc Active 0.572 inst/cycle 0.000 5
SM Busy 14.334 % 0.040 5
Memory Throughput 732336081093.370 byte/second 28427786179001982976.000 5
Mem Busy 12.650 % 0.009 5
Max Bandwidth 21.910 % 0.029 5
L1/TEX Hit Rate 0.000 % 0.000 5
L2 Hit Rate 13.244 % 0.001 5
Mem Pipes Busy 6.402 % 0.002 5
Warp Cycles Per Issued Instruction 13.892 cycle 0.055 5
Warp Cycles Per Executed Instruction 14.054 cycle 0.057 5
Avg. Active Threads Per Warp 31.770 0.000 5
Avg. Not Predicated Off Threads Per Warp 27.720 0.000 5
Max Active Clusters 0.000 cluster 0.000 5
Max Cluster Size 8.000 block 0.000 5
Overall GPU Occupancy 0.000 % 0.000 5
Cluster Occupancy 0.000 % 0.000 5
Block Limit SM 32.000 block 0.000 5
Block Limit Registers 8.000 block 0.000 5
Block Limit Shared Mem 21.000 block 0.000 5
Block Limit Warps 8.000 block 0.000 5
Theoretical Active Warps per SM 64.000 warp 0.000 5
Theoretical Occupancy 100.000 % 0.000 5
Achieved Occupancy 12.158 % 0.000 5
Achieved Active Warps Per SM 7.782 warp 0.000 5
Analysis Rules
Rule Description
WRN HighPipeUtilization All compute pipelines are under-utilized. Either this kernel is very small or it doesn't issue enough warps per scheduler. Check the Launch Statistics and Scheduler Statistics sections for further details.
INF CPIStall Check the Warp Stall Sampling (All Cycles) table for the top stall locations in your source based on sampling data. The Kernel Profiling Guide (https://docs.nvidia.com/nsight-compute/ProfilingGuide/index.html#metrics-reference) provides more details on each stall reason.
WRN Occupancy This kernel's theoretical occupancy is not impacted by any block limit. The difference between calculated theoretical (100.0%) and measured achieved occupancy (12.2%) can be the result of warp scheduling overheads or workload imbalances during the kernel execution. Load imbalances can occur between warps within a block as well as across blocks of the same kernel. See the CUDA Best Practices Guide (https://docs.nvidia.com/cuda/cuda-c-best-practices-guide/index.html#occupancy) for more details on optimizing occupancy.
Operation / Metric Value Unit
aten::zeros
CPU Time 5039990.16 μs
Device Time 218504.48 μs
Self CPU Time 135475.70 μs
Self Device Time 0.00 μs
CPU Memory Usage 0 B
Device Memory Usage 0 B
Self CPU Memory Usage 0 B
Self Device Memory Usage 0 B
aten::zero_
CPU Time 5346226.05 μs
Device Time 7145316.61 μs
Self CPU Time 280850.34 μs
Self Device Time 0.00 μs
CPU Memory Usage 0 B
Device Memory Usage 0 B
Self CPU Memory Usage 0 B
Self Device Memory Usage 0 B
aten::fill_
CPU Time 5065379.62 μs
Device Time 7145316.61 μs
Self CPU Time 345528.95 μs
Self Device Time 7145316.61 μs
CPU Memory Usage 0 B
Device Memory Usage 0 B
Self CPU Memory Usage 0 B
Self Device Memory Usage 0 B
cudaLaunchKernel
CPU Time 5430862.57 μs
Device Time 451828.76 μs
Self CPU Time 5430862.57 μs
Self Device Time 451828.76 μs
CPU Memory Usage 0 B
Device Memory Usage 0 B
Self CPU Memory Usage 0 B
Self Device Memory Usage 0 B
void hybrid_triplet_margin_loss_kernel<float>(float const*, float const*, float const*, float*, float, int, int)
CPU Time 0.00 μs
Device Time 734127.69 μs
Self CPU Time 0.00 μs
Self Device Time 734127.69 μs
CPU Memory Usage 0 B
Device Memory Usage 0 B
Self CPU Memory Usage 0 B
Self Device Memory Usage 0 B
aten::mean
CPU Time 1104719.29 μs
Device Time 317631.25 μs
Self CPU Time 678136.21 μs
Self Device Time 317631.25 μs
CPU Memory Usage 0 B
Device Memory Usage 0 B
Self CPU Memory Usage 0 B
Self Device Memory Usage 0 B
void at::native::vectorized_elementwise_kernel<4, at::native::FillFunctor<int>, at::detail::Array<char*, 1> >(int, at::native::FillFunctor<int>, at::detail::Array<char*, 1>)
CPU Time 0.00 μs
Device Time 6926812.14 μs
Self CPU Time 0.00 μs
Self Device Time 6926812.14 μs
CPU Memory Usage 0 B
Device Memory Usage 0 B
Self CPU Memory Usage 0 B
Self Device Memory Usage 0 B
Status: Failed
45255 warnings and 1 error generated when compiling for host.
Error while processing /home/robert_sakana_ai/llm_cuda/experiments/20250212_optimize_b5_s4_e1_v2/level_1/task_99/b4_s2_hybrid_reduction_triplet_loss/base/base.cu.
Suppressed 45289 warnings (45242 in non-user code, 47 NOLINT).
Use -header-filter=.* to display errors from all non-system headers. Use -system-headers to display errors from system headers as well.
Found compiler error(s).
/home/robert_sakana_ai/llm_cuda/experiments/20250212_optimize_b5_s4_e1_v2/level_1/task_99/b4_s2_hybrid_reduction_triplet_loss/base/base.cu:7:5 bugprone-easily-swappable-parameters
7 | const scalar_t* __restrict__ anchor,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
8 | const scalar_t* __restrict__ positive,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
9 | const scalar_t* __restrict__ negative,
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/robert_sakana_ai/llm_cuda/experiments/20250212_optimize_b5_s4_e1_v2/level_1/task_99/b4_s2_hybrid_reduction_triplet_loss/base/base.cu:7:34: note: the first parameter in the range is 'anchor'
7 | const scalar_t* __restrict__ anchor,
| ^~~~~~
/home/robert_sakana_ai/llm_cuda/experiments/20250212_optimize_b5_s4_e1_v2/level_1/task_99/b4_s2_hybrid_reduction_triplet_loss/base/base.cu:9:34: note: the last parameter in the range is 'negative'
9 | const scalar_t* __restrict__ negative,
| ^~~~~~~~
/home/robert_sakana_ai/llm_cuda/experiments/20250212_optimize_b5_s4_e1_v2/level_1/task_99/b4_s2_hybrid_reduction_triplet_loss/base/base.cu:11:5: warning: 2 adjacent parameters of 'hybrid_triplet_margin_loss_kernel' of convertible types are easily swapped by mistake [bugprone-easily-swappable-parameters]
11 | const float margin,
| ^~~~~~~~~~~~~~~~~~~
12 | const int batch_size,
| ~~~~~~~~~~~~~~~~~~~~
/home/robert_sakana_ai/llm_cuda/experiments/20250212_optimize_b5_s4_e1_v2/level_1/task_99/b4_s2_hybrid_reduction_triplet_loss/base/base.cu:11:17: note: the first parameter in the range is 'margin'
11 | const float margin,
| ^~~~~~
/home/robert_sakana_ai/llm_cuda/experiments/20250212_optimize_b5_s4_e1_v2/level_1/task_99/b4_s2_hybrid_reduction_triplet_loss/base/base.cu:12:15: note: the last parameter in the range is 'batch_size'
12 | const int batch_size,
| ^~~~~~~~~~
/home/robert_sakana_ai/llm_cuda/experiments/20250212_optimize_b5_s4_e1_v2/level_1/task_99/b4_s2_hybrid_reduction_triplet_loss/base/base.cu:12:5: note: 'const float' and 'const int' may be implicitly converted: 'const float' (as 'float') -> 'const int' (as 'int'), 'const int' (as 'int') -> 'const float' (as 'float')
12 | const int batch_size,
| ^
/home/robert_sakana_ai/llm_cuda/experiments/20250212_optimize_b5_s4_e1_v2/level_1/task_99/b4_s2_hybrid_reduction_triplet_loss/base/base.cu:19:21: warning: narrowing conversion from 'unsigned int' to signed type 'int' is implementation-defined [bugprone-narrowing-conversions]
19 | const int tid = threadIdx.x;
| ^
/home/robert_sakana_ai/llm_cuda/experiments/20250212_optimize_b5_s4_e1_v2/level_1/task_99/b4_s2_hybrid_reduction_triplet_loss/base/base.cu:20:21: warning: narrowing conversion from 'unsigned int' to signed type 'int' is implementation-defined [bugprone-narrowing-conversions]
20 | const int bid = blockIdx.x;
| ^
/home/robert_sakana_ai/llm_cuda/experiments/20250212_optimize_b5_s4_e1_v2/level_1/task_99/b4_s2_hybrid_reduction_triplet_loss/base/base.cu:23:29: warning: narrowing conversion from 'unsigned int' to signed type 'int' is implementation-defined [bugprone-narrowing-conversions]
23 | const int grid_stride = gridDim.x * blockDim.x;
| ^
/home/robert_sakana_ai/llm_cuda/experiments/20250212_optimize_b5_s4_e1_v2/level_1/task_99/b4_s2_hybrid_reduction_triplet_loss/base/base.cu:30:20: warning: narrowing conversion from 'unsigned int' to signed type 'int' is implementation-defined [bugprone-narrowing-conversions]
30 | for (int idx = bid * blockDim.x + tid; idx < batch_size * feat_size; idx += grid_stride) {
| ^
/home/robert_sakana_ai/llm_cuda/experiments/20250212_optimize_b5_s4_e1_v2/level_1/task_99/b4_s2_hybrid_reduction_triplet_loss/base/base.cu:60:27: warning: narrowing conversion from 'unsigned int' to signed type 'int' is implementation-defined [bugprone-narrowing-conversions]
60 | const int num_warps = (blockDim.x + warpSize - 1) / warpSize;
| ^
/home/robert_sakana_ai/llm_cuda/experiments/20250212_optimize_b5_s4_e1_v2/level_1/task_99/b4_s2_hybrid_reduction_triplet_loss/base/base.cu:94:28: warning: narrowing conversion from 'int64_t' (aka 'long') to signed type 'int' is implementation-defined [bugprone-narrowing-conversions]
94 | const int batch_size = anchor.size(0);
| ^
/home/robert_sakana_ai/llm_cuda/experiments/20250212_optimize_b5_s4_e1_v2/level_1/task_99/b4_s2_hybrid_reduction_triplet_loss/base/base.cu:95:27: warning: narrowing conversion from 'int64_t' (aka 'long') to signed type 'int' is implementation-defined [bugprone-narrowing-conversions]
95 | const int feat_size = anchor.size(1);
| ^
/home/robert_sakana_ai/llm_cuda/experiments/20250212_optimize_b5_s4_e1_v2/level_1/task_99/b4_s2_hybrid_reduction_triplet_loss/base/base.cu:99:24: error: no matching function for call to 'min' [clang-diagnostic-error]
99 | const int blocks = min(batch_size, 1024); // Limit max blocks for better occupancy
| ^~~
/home/common_modules/clang-tidy/20.0.0git/lib/clang/20/include/__clang_cuda_math.h:201:16: note: candidate function not viable: call to __device__ function from __host__ function
201 | __DEVICE__ int min(int __a, int __b) { return __nv_min(__a, __b); }
| ^
/usr/local/cuda/include/crt/math_functions.hpp:868:38: note: candidate function not viable: call to __device__ function from __host__ function
868 | __MATH_FUNCTIONS_DECL__ unsigned int min(const unsigned int a, const unsigned int b)
| ^
/usr/local/cuda/include/crt/math_functions.hpp:873:38: note: candidate function not viable: call to __device__ function from __host__ function
873 | __MATH_FUNCTIONS_DECL__ unsigned int min(const int a, const unsigned int b)
| ^
/usr/local/cuda/include/crt/math_functions.hpp:878:38: note: candidate function not viable: call to __device__ function from __host__ function
878 | __MATH_FUNCTIONS_DECL__ unsigned int min(const unsigned int a, const int b)
| ^
/usr/local/cuda/include/crt/math_functions.hpp:883:34: note: candidate function not viable: call to __device__ function from __host__ function
883 | __MATH_FUNCTIONS_DECL__ long int min(const long int a, const long int b)
| ^
/usr/local/cuda/include/crt/math_functions.hpp:902:43: note: candidate function not viable: call to __device__ function from __host__ function
902 | __MATH_FUNCTIONS_DECL__ unsigned long int min(const unsigned long int a, const unsigned long int b)
| ^
/usr/local/cuda/include/crt/math_functions.hpp:919:43: note: candidate function not viable: call to __device__ function from __host__ function
919 | __MATH_FUNCTIONS_DECL__ unsigned long int min(const long int a, const unsigned long int b)
| ^
/usr/local/cuda/include/crt/math_functions.hpp:936:43: note: candidate function not viable: call to __device__ function from __host__ function
936 | __MATH_FUNCTIONS_DECL__ unsigned long int min(const unsigned long int a, const long int b)
| ^
/usr/local/cuda/include/crt/math_functions.hpp:953:39: note: candidate function not viable: call to __device__ function from __host__ function
953 | __MATH_FUNCTIONS_DECL__ long long int min(const long long int a, const long long int b)
| ^
/usr/local/cuda/include/crt/math_functions.hpp:958:48: note: candidate function not viable: call to __device__ function from __host__ function
958 | __MATH_FUNCTIONS_DECL__ unsigned long long int min(const unsigned long long int a, const unsigned long long int b)
| ^
/usr/local/cuda/include/crt/math_functions.hpp:963:48: note: candidate function not viable: call to __device__ function from __host__ function
963 | __MATH_FUNCTIONS_DECL__ unsigned long long int min(const long long int a, const unsigned long long int b)
| ^
/usr/local/cuda/include/crt/math_functions.hpp:968:48: note: candidate function not viable: call to __device__ function from __host__ function
968 | __MATH_FUNCTIONS_DECL__ unsigned long long int min(const unsigned long long int a, const long long int b)
| ^
/usr/local/cuda/include/crt/math_functions.hpp:973:31: note: candidate function not viable: call to __device__ function from __host__ function
973 | __MATH_FUNCTIONS_DECL__ float min(const float a, const float b)
| ^
/usr/local/cuda/include/crt/math_functions.hpp:978:32: note: candidate function not viable: call to __device__ function from __host__ function
978 | __MATH_FUNCTIONS_DECL__ double min(const double a, const double b)
| ^
/usr/local/cuda/include/crt/math_functions.hpp:983:32: note: candidate function not viable: call to __device__ function from __host__ function
983 | __MATH_FUNCTIONS_DECL__ double min(const float a, const double b)
| ^
/usr/local/cuda/include/crt/math_functions.hpp:988:32: note: candidate function not viable: call to __device__ function from __host__ function
988 | __MATH_FUNCTIONS_DECL__ double min(const double a, const float b)
| ^
/home/robert_sakana_ai/llm_cuda/experiments/20250212_optimize_b5_s4_e1_v2/level_1/task_99/b4_s2_hybrid_reduction_triplet_loss/base/base.cu:104:33: warning: performing an implicit widening conversion to type 'unsigned long' of a multiplication performed in type 'int' [bugprone-implicit-widening-of-multiplication-result]
104 | const int shared_mem_size = 2 * threads_per_block * sizeof(float);
| ^
/home/robert_sakana_ai/llm_cuda/experiments/20250212_optimize_b5_s4_e1_v2/level_1/task_99/b4_s2_hybrid_reduction_triplet_loss/base/base.cu:104:33: note: make conversion explicit to silence this warning
4 | const int shared_mem_size = 2 * threads_per_block * sizeof(float);
| ^~~~~~~~~~~~~~~~~~~~~
| static_cast<unsigned long>( )
/home/robert_sakana_ai/llm_cuda/experiments/20250212_optimize_b5_s4_e1_v2/level_1/task_99/b4_s2_hybrid_reduction_triplet_loss/base/base.cu:104:33: note: perform multiplication in a wider type
104 | const int shared_mem_size = 2 * threads_per_block * sizeof(float);
| ^
| static_cast<long>( )
/home/robert_sakana_ai/llm_cuda/experiments/20250212_optimize_b5_s4_e1_v2/level_1/task_99/b4_s2_hybrid_reduction_triplet_loss/base/base.cu:106:5: warning: inside a lambda, '__func__' expands to the name of the function call operator; consider capturing the name of the enclosing function explicitly [bugprone-lambda-function-name]
106 | AT_DISPATCH_FLOATING_TYPES(anchor.scalar_type(), "hybrid_triplet_margin_loss_kernel", ([&] {
| ^
/home/robert_sakana_ai/miniconda3/envs/llm2cuda/lib/python3.11/site-packages/torch/include/ATen/Dispatch.h:237:34: note: expanded from macro 'AT_DISPATCH_FLOATING_TYPES'
237 | AT_DISPATCH_SWITCH(TYPE, NAME, AT_DISPATCH_CASE_FLOATING_TYPES(__VA_ARGS__))
| ^
/home/robert_sakana_ai/miniconda3/envs/llm2cuda/lib/python3.11/site-packages/torch/include/ATen/Dispatch.h:233:3: note: expanded from macro 'AT_DISPATCH_CASE_FLOATING_TYPES'
233 | AT_DISPATCH_CASE(at::ScalarType::Double, __VA_ARGS__) \
| ^
/home/robert_sakana_ai/miniconda3/envs/llm2cuda/lib/python3.11/site-packages/torch/include/ATen/Dispatch.h:74:3: note: expanded from macro 'AT_DISPATCH_CASE'
74 | AT_PRIVATE_CASE_TYPE_USING_HINT(enum_type, scalar_t, __VA_ARGS__)
| ^
note: (skipping 1 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
/home/robert_sakana_ai/miniconda3/envs/llm2cuda/lib/python3.11/site-packages/torch/include/ATen/Dispatch.h:58:7: note: expanded from macro 'AT_PRIVATE_CHECK_SELECTIVE_BUILD'
58 | AT_ERROR( \
| ^
/home/robert_sakana_ai/miniconda3/envs/llm2cuda/lib/python3.11/site-packages/torch/include/c10/util/Exception.h:711:32: note: expanded from macro 'AT_ERROR'
711 | C10_EXPAND_MSVC_WORKAROUND(TORCH_CHECK(false, ::c10::str(__VA_ARGS__))); \
| ^
/home/robert_sakana_ai/miniconda3/envs/llm2cuda/lib/python3.11/site-packages/torch/include/c10/util/Exception.h:536:9: note: expanded from macro 'TORCH_CHECK'
536 | __func__, \
| ^