potentialpaper

Flash-SD-KDE: Accelerating SD-KDE with Tensor Cores

Elliot L Epstein, Rajat Vadiraj Dwaraknath, John Winnicki

SPIGM @ ICML 2026

Edit this page

Or clone it with git

Run in a terminal:

Needs Git LFS. To push, use an API key from your profile as the password.

Or let your agent set it up

It checks and sets up everything: signing in, git, the clone, credentials and an SSH key.

TL;DR. By exploiting GPU Tensor Cores, we make score-debiased kernel density estimation practical at large scale

Abstract. Score-debiased kernel density estimation (SD-KDE) achieves improved asymptotic convergence rates over classical KDE, but its use of an empirical score has made it significantly slower in practice. We show that by re-ordering the SD-KDE computation to expose matrix-multiplication structure, Tensor Cores can be used to accelerate the GPU implementation. On a 32k-sample 16-dimensional problem, our approach runs up to 47×47\times faster than a strong SD-KDE GPU baseline and 3,300×3{,}300\times faster than scikit-learn's KDE. On a larger 1m-sample 16-dimensional task evaluated on 131k queries, Flash-SD-KDE completes in 2.32.3 s on a single GPU, making score-debiased density estimation practical at previously infeasible scales.

Are you an author? Claim this paper to see who's reading it, with views and other statistics, and to write about it here.

Claim this paper
How does this paper connect to your work? Write how you built on it, compared with it or reproduced it, or add a summary, a critique or errata.
Or make it interactive:
Start writing

edit · history

FromAToBDateVersionSubmitted toPDFEvidence
5 May 2026NeurIPS 2026submittedNeurIPS 2026Accept (poster)reviews ↓[1]—[1]
9 May 2026SPIGM @ ICML 2026submittedSPIGM @ ICML 2026Accepted · Poster—[1]
Their titles, abstracts and, where both have a PDF, the text.Missing a version?

NeurIPS 2026

Accept (poster) · 3 reviews · OpenReview

Updated 25 Nov 2026, 03:46 UTC.

Program Chairs · DecisionOpenReview ↗
Decision
Accept (poster)
Read decision
Meta-review

The paper presents a systems-oriented acceleration of the existing SD-KDE estimator, whose empirical score computation introduces substantial quadratic computational and memory costs. It reorganizes the score-estimation and density-evaluation stages into Tensor-Core-friendly matrix operations and implements them using tiled, streaming Triton kernels that avoid materializing full pairwise interaction matrices. The reported results include speedups of up to 47× over an eager PyTorch SD-KDE implementation and over 3,300× over scikit-learn KDE. The paper also introduces Flash-Laplace-KDE, a fused surrogate to provide similar bias-reduction benefits without explicit score-estimation pass.

The principal strength is the magnitude of the reported performance gains and their potential to make SD-KDE practical at substantially larger scales. The GEMM reformulation and streaming accumulation are regarded as technically sound and well aligned with modern GPU architectures. The implementation coherently combines Tensor-Core execution, tiling, and memory-aware streaming to reduce both runtime and the storage required for pairwise interactions. The reviews also highlight the effective use of Triton for managing tiling and the memory hierarchy, as well as the ablation studies that help explain where the acceleration arises.

A recurring concern is whether the reported gains reflect the implementation advances beyond a conventional GEMM-based PyTorch or cuBLAS formulation. In particular, current presentation does not clarify whether the PyTorch and torch.compile baselines already use Tensor Cores under comparable datatype and precision settings, or which aspects of the custom implementation account for the remaining performance difference. A second recurring concern is the numerical impact of TF32 or other reduced-precision execution. The evaluation does not directly establish whether datatype casting or Tensor-Core arithmetic materially affects the accuracy of the estimated scores or density values. The reviewers also have disagreements on the novelty, especially the limited novelty in methodology by primarily combining established GPU techniques. In addition, concerns are raised on the performance at dimensions above 32, particularly 64 and 128; possible negative density values and the behavior of Flash-Laplace-KDE on non-Gaussian or heavy-tailed distributions; roofline analysis and broader application evidence; and a more detailed latency breakdown together with clarification of whether the score-estimation and KDE stages could be fused.

Regarding the rebuttal, the most consequential issues are baseline comparability, performance attribution, and numerical fidelity. The authors should clarify which implementation choices provide benefits beyond a standard GEMM formulation and whether the PyTorch and torch.compile baselines already use Tensor Cores. A detailed compiled graph for the torch.compile baseline would make this comparison more concrete. The response should also explain whether the datatype casting required for Tensor-Core execution, including the use of TF32 or other reduced-precision arithmetic, materially affects SD-KDE accuracy. A pass-level latency breakdown would help clarify where the reported speedups arise and strengthen the attribution of the performance gains. Results or analysis at dimensions such as 64 and 128 would also clarify whether the acceleration extends beyond the primarily evaluated low-dimensional regime. For Flash-Laplace-KDE, clarification of its behavior on non-Gaussian or heavy-tailed distributions and the practical implications of possible negative density values would address the remaining concern about this auxiliary contribution.

Final justification

The reviewers generally agree that this paper addresses an important practical problem in making score-debiased KDE scalable and reports substantial speedups through Tensor-Core-friendly GEMM reformulation and streaming Triton kernels. The main concerns in the initial reviews include limited systems novelty relative to standard GEMM/cuBLAS practice, unclear baseline Tensor-Core usage, the numerical impact of TF32, incomplete latency attribution, limited evaluation beyond low dimensions, and the behavior of Flash-Laplace-KDE on heavy-tailed data. During the rebuttal, the authors addressed most of these concerns with a performance-decomposition ladder, the torch.compile execution graph, TF32-versus-resampling numerical comparisons, higher-dimensional scaling results, pass-level latency breakdowns, roofline analysis, and heavy-tailed/negative-density studies. These additions substantially strengthen the experimental evidence, and the reviewers’ final assessments are overall positive. Some concerns remain regarding presentation clarity of the execution mechanism and the degree of methodological novelty, but these are not critical issues. Overall, the paper is technically sound, practically relevant, and sufficiently supported by the updated experiments.

Given the the final score profile (3/5/4) with only one borderline reject whose remaining concern is presentation clarity rather than technical correctness or significance of contributions, I recommend an acceptance.

Area Chair LN3f · Meta-reviewOpenReview ↗
Read meta-review
Meta-review

The paper presents a systems-oriented acceleration of the existing SD-KDE estimator, whose empirical score computation introduces substantial quadratic computational and memory costs. It reorganizes the score-estimation and density-evaluation stages into Tensor-Core-friendly matrix operations and implements them using tiled, streaming Triton kernels that avoid materializing full pairwise interaction matrices. The reported results include speedups of up to 47× over an eager PyTorch SD-KDE implementation and over 3,300× over scikit-learn KDE. The paper also introduces Flash-Laplace-KDE, a fused surrogate to provide similar bias-reduction benefits without explicit score-estimation pass.

The principal strength is the magnitude of the reported performance gains and their potential to make SD-KDE practical at substantially larger scales. The GEMM reformulation and streaming accumulation are regarded as technically sound and well aligned with modern GPU architectures. The implementation coherently combines Tensor-Core execution, tiling, and memory-aware streaming to reduce both runtime and the storage required for pairwise interactions. The reviews also highlight the effective use of Triton for managing tiling and the memory hierarchy, as well as the ablation studies that help explain where the acceleration arises.

A recurring concern is whether the reported gains reflect the implementation advances beyond a conventional GEMM-based PyTorch or cuBLAS formulation. In particular, current presentation does not clarify whether the PyTorch and torch.compile baselines already use Tensor Cores under comparable datatype and precision settings, or which aspects of the custom implementation account for the remaining performance difference. A second recurring concern is the numerical impact of TF32 or other reduced-precision execution. The evaluation does not directly establish whether datatype casting or Tensor-Core arithmetic materially affects the accuracy of the estimated scores or density values. The reviewers also have disagreements on the novelty, especially the limited novelty in methodology by primarily combining established GPU techniques. In addition, concerns are raised on the performance at dimensions above 32, particularly 64 and 128; possible negative density values and the behavior of Flash-Laplace-KDE on non-Gaussian or heavy-tailed distributions; roofline analysis and broader application evidence; and a more detailed latency breakdown together with clarification of whether the score-estimation and KDE stages could be fused.

Regarding the rebuttal, the most consequential issues are baseline comparability, performance attribution, and numerical fidelity. The authors should clarify which implementation choices provide benefits beyond a standard GEMM formulation and whether the PyTorch and torch.compile baselines already use Tensor Cores. A detailed compiled graph for the torch.compile baseline would make this comparison more concrete. The response should also explain whether the datatype casting required for Tensor-Core execution, including the use of TF32 or other reduced-precision arithmetic, materially affects SD-KDE accuracy. A pass-level latency breakdown would help clarify where the reported speedups arise and strengthen the attribution of the performance gains. Results or analysis at dimensions such as 64 and 128 would also clarify whether the acceleration extends beyond the primarily evaluated low-dimensional regime. For Flash-Laplace-KDE, clarification of its behavior on non-Gaussian or heavy-tailed distributions and the practical implications of possible negative density values would address the remaining concern about this auxiliary contribution.

Final justification

The reviewers generally agree that this paper addresses an important practical problem in making score-debiased KDE scalable and reports substantial speedups through Tensor-Core-friendly GEMM reformulation and streaming Triton kernels. The main concerns in the initial reviews include limited systems novelty relative to standard GEMM/cuBLAS practice, unclear baseline Tensor-Core usage, the numerical impact of TF32, incomplete latency attribution, limited evaluation beyond low dimensions, and the behavior of Flash-Laplace-KDE on heavy-tailed data. During the rebuttal, the authors addressed most of these concerns with a performance-decomposition ladder, the torch.compile execution graph, TF32-versus-resampling numerical comparisons, higher-dimensional scaling results, pass-level latency breakdowns, roofline analysis, and heavy-tailed/negative-density studies. These additions substantially strengthen the experimental evidence, and the reviewers’ final assessments are overall positive. Some concerns remain regarding presentation clarity of the execution mechanism and the degree of methodological novelty, but these are not critical issues. Overall, the paper is technically sound, practically relevant, and sufficiently supported by the updated experiments.

Given the the final score profile (3/5/4) with only one borderline reject whose remaining concern is presentation clarity rather than technical correctness or significance of contributions, I recommend an acceptance.

Reviewer YaGfOpenReview ↗
Rating
4/6
Confidence
3/5
Quality
3/4
Clarity
3/4
Significance
3/4
Originality
2/4
Contribution type
general
Ethical concerns
NO or VERY MINOR ethics concerns only
Read review
Summary

This paper accelerates SD-KDE using GPU's Tensor Core to make it computationally practical. The authors reform pairwise squared distances as few matrix multiplications, enabling Tensor Core acceleration via a custom Triton kernel. Instead of materializing the full matrix, the authors stream submatrices to keep memory footprint linear. Also, they propose Flash-Laplace-KDE, which replaces the empirical score with an analytically-derived Laplace-corrected kernel, which shares the same bias as SD-KDE but requires no score pass, enabling kernel fusion in a single pass. The results show that the proposed Flash-SD-KDE runs 47x faster than a strong PyTorch baseline.

Strengths and weaknesses

The paper is technically sound, with a GEMM reformulation using algebraic decompositions, and ablation studies to show where the speedup comes from. The paper is clearly written and well-organized. SD-KDE has been computationally impractical at scale, but this paper brings a 1M-sample case down to 2.3s on a single GPU. However, while this work is well-motivated and brings practicability of SD-KDE, most of the techniques on GPU are known and lack novelty. Also, the baseline's Tensor Core usage is not clear -- I think Tensor Core will be used when each ops is casted properly. Especially, please provide a detailed compiled graph of torch.compile since torch.compile can do the tiling.

Questions
  1. Can you please provide a latency breakdown of the existing SD-KDE steps of the baseline (CPU/Torch/etc) and Flash-SD-KDE?
  2. Tensor Core works on certain dtypes. Are there any numerical impacts in the use case when you cast the numbers?
  3. Is kernel fusion between score and KDE passes possible?
Limitations

Please refer to the Weakness section above.

Final justification

Thanks for the rebuttal and addressing concern. Since I do not have strong concerns of the paper, I will raise my score to 4.

Formatting concerns

N/A

1 comment
Authors · CommentOpenReview ↗

Rebuttal to Reviewer YaGf

Thank you for your insightful review.

W1 (novelty of the GPU techniques): The individual techniques (tiling, streaming, mixed precision) are indeed known, as they were for FlashAttention, whose contribution was showing that reordering one specific primitive unlocks a new capability regime. Our contributions are estimator-specific and not obtainable from generic tooling: (i) the algebraic reordering ∑j(xi−xj)φij=xi∑jφij−(ΦX)i\sum_j (x_i - x_j)\varphi_{ij} = x_i \sum_j \varphi_{ij} - (\Phi X)_i, which turns the empirical-score numerator into two GEMMs; (ii) the streaming formulation that makes exact SD-KDE run at n≈106n \approx 10^6 on one GPU for the first time; and (iii) Flash-Laplace-KDE, a new fused surrogate estimator with the same leading-order bias correction and no score pass.

W2 (whether torch.compile's tiling could derive this kernel): The reviewer is correct that torch.compile (TorchInductor) performs tiling, but only for the class of programs it can express: fusions of pointwise, reduction, and scatter ops, plus matmuls with limited prologue/epilogue fusion. Our kernel requires fusing through two matmuls: it computes the pairwise inner products XX⊤XX^\top, applies exp elementwise, and immediately consumes the result Φ\Phi in both a row-reduction and a second matmul ΦX\Phi X, keeping each tile of the n×nn \times n matrix Φ\Phi in registers. Inductor does not fuse the output of one matmul into the input of another; matmuls dispatch as separate kernels (cuBLAS or Triton templates), so Φ\Phi must be materialized in HBM between them (see W3 for details). This is precisely the transformation that motivated FlashAttention (Dao et al., 2022), which shares the matmul →\to elementwise →\to matmul structure.

W3 (baseline Tensor-Core usage, compiled graph of torch.compile): Yes, the baselines use Tensor Cores. However, Tensor Cores make little difference to the baseline because it is bandwidth bound, with only 11% of its runtime in GEMMs. The other 89% of the time is spent moving n2n^2 intermediates through global memory, which no kernel-by-kernel implementation can avoid because separate kernels communicate through it. Tensor Cores become useful once fusion removes the n2n^2 traffic, at which point the same hardware yields 4.94×4.94\times inside our streamed kernel (Table 5).

The requested compiled graph, the complete Inductor execution plan for the compiled score pass is:

buf0 = empty_strided_cuda((32768, 1))                 # row norms
triton_per_fused_mul_sum_0(X -> buf0)                 # negligible
buf1 = empty_strided_cuda((32768, 32768))             # the single 4 GB n^2 buffer
extern_kernels.mm(X, X^T, out=buf1)                   # cuBLAS -> cutlass_80_tensorop_s1688gemm
                                                      #   (TF32, Tensor Cores), ~25% of kernel time
buf2 = buf1  # reuse: Phi overwrites the Gram in place
triton_red_fused_add_clamp_exp_mul_permute_sub_sum_1  # dist + exp + row-sums fused;
  (buf2, buf0 -> buf2, buf4)                          #   reads Gram, writes Phi, ~50%
extern_kernels.mm(buf2, X, out=buf3)                  # cuBLAS -> ampere_sgemm (Phi @ X), ~25%
triton_poi_fused_add_div_mul_sub_2                    # debias epilogue, negligible

Every elementwise op is fused into two Triton kernels, and the memory planner reuses the single n2n^2 buffer by overwriting the Gram with Φ\Phi. So torch.compile can indeed tile, but only within each kernel it generates.

Q1 (latency breakdown): We measured the score and KDE passes separately for each implementation at d=16d=16, ntrain=32,768n_{\text{train}}=32{,}768, ntest=4,096n_{\text{test}}=4{,}096 on the paper's workstation, reporting the minimum over repeated interleaved runs. The CPU row runs the same eager formulation on the host's dual EPYC 7763 with 128 threads, since the scikit-learn baseline of Table 1 has no score pass to break down:

Method Score pass (ms) KDE pass (ms) Total (ms) Score share
PyTorch on CPU (dual EPYC 7763) 6,245 767 7,012 89%
PyTorch (Table 1 baseline) 100.8 12.1 112.8 89%
Flash-SD-KDE 2.07 0.27 2.34 88%

Q2 (numerical impact of dtype casting): Inputs are stored FP32, accumulation is FP32, and TF32 only rounds the tl.dot inputs' mantissas. New experiment (n=32,768n=32{,}768): relative to the identical kernel run in full FP32 without Tensor Cores (precision_mode="fp32_ieee"), TF32 perturbs each density estimate by 3.2% on average; re-drawing the full nn-point training set perturbs the same estimates by 7.2% on average, so the hardware effect is within the estimator's sampling noise.

Q3 (fusing the score and KDE passes): It is possible, but Amdahl's law caps the benefit: the score pass is around 90% of runtime (see Appendix A.6), so fusing the two passes saves at most 10% for nontrivial code complexity, which is why we kept the two-kernel structure.

Reviewer 3kmdOpenReview ↗
Rating
5/6
Confidence
3/5
Quality
3/4
Clarity
4/4
Significance
3/4
Originality
3/4
Contribution type
general
Ethical concerns
NO or VERY MINOR ethics concerns only
Read review
Summary

This paper provides a new technique to speed up Score-Debiased Kernel Density Estimation (SD-KDE) by leveraging specific tensor cores in commercial GPUs available today. SD-KDE provides superior asymptotic convergence compared to standard KDE, but if suffers from the high computational cost of its empirical score estimation. The authors demonstrate that the O(n2)O(n^2) complexity of SD-KDE is not an insurmountable barrier, but rather a dataflow problem. By reordering the score and KDE computations to expose matrix-multiplication structures, they leverage Tensor Cores and streaming accumulation to achieve significant speedups. Additionally, they propose a Flash-Laplace KDE surrogate that provides similar bias-reduction benefits without the explicit score-estimation overhead.

Strengths and weaknesses

This work addresses the central challenge of making statistically efficient nonparametric density estimation viable for large-scale machine learning applications. The paper is technically robust, characterized by a clear derivation of the matrix-form SD-KDE and arithmetic intensity analysis that aligns with the performance characteristics of the NVIDIA RTX A6000.

Strengths.

The implementation, utilizing Triton to manage tiling and memory hierarchy, is quite nice. The authors successfully move the computation into the compute-bound regime, effectively utilizing the hardware’s Tensor Cores.

The paper is well-structured and easy to follow. I also appreciated the clarity and definitions of SD-KDE, followed by the mapping to the hardware-native matrix implementation.

The claims of the paper are well-supported by empirical evidence. The speedups reported (up to 47× over PyTorch baselines and 3,300× over scikit-learn) are transformative for practitioners who require exact density estimation at the scale of 10610^6 samples. These are STRONG numbers.

The application of Flash-style streaming/tiling to the SD-KDE pipeline is a clever adaptation of existing attention-acceleration techniques.

Weaknesses.

The main weakness is that the paper primarily focuses on d=16. While this dimension is useful for many anomaly detection tasks, the performance characteristics of these kernels in higher-dimensional spaces (where KDE typically struggles) remain an open question.

Additionally, the Laplace-corrected variant's potential for negative density values is a minor concern that requires careful integration into downstream workflows.

Questions

As d increases, the "curse of dimensionality" typically forces bandwidth h to change, which impacts the GEMM structure. How does the performance scale as d approaches 64 or 128? It would be important to see an ablation study on the impact of d on Tensor Core utilization.

If the authors could provide a more detailed analysis of the performance trade-offs in higher dimensions (d>32) or demonstrate that the implementation remains compute-bound when using static, lower-precision data types, that would help me give a better score to the paper.

Further, I want to understand the impact of proposed Laplace-corrected surrogate compared to the full SD-KDE on non-Gaussian, heavy-tailed distributions.

Limitations

Yes

Formatting concerns

None

2 comments
Authors · CommentOpenReview ↗

Rebuttal to Reviewer 3kmd

Thank you for your thorough and positive review. New experiment are all on the same RTX A6000 GPU used in the paper.

Q1 (performance as dd approaches 64 or 128, Tensor-Core utilization vs. dd): Flash-SD-KDE runtime grows linearly in dd as the compute-bound model predicts, and Tensor-Core utilization holds at 19 to 30% of peak across the sweep. The bandwidth hh enters only through the scalar exp⁡(−r2/2h2)\exp(-r^2/2h^2), so growing hh with dd does not affect the GEMM structure. We swept dd at ntrain=32,768n_{\text{train}}=32{,}768, ntest=4,096n_{\text{test}}=4{,}096.

dd Flash-SD-KDE (ms) Fraction of TC peak Tensor Cores off (ms) TC speedup
16 2.4 23% 10.5 4.4×4.4\times
32 3.5 30% 18.3 5.3×5.3\times
64 6.8 29% 37.2 5.5×5.5\times
128 19.8 19% 73.2 3.7×3.7\times

Sustaining 19 to 30% of the absolute Tensor-Core peak is the expected level for this estimator, because the kernel interleaves its GEMM tiles with the O(n2)O(n^2) non-Tensor-Core work (norms, exponentials, atomic accumulations) that runs on FP32 ALUs and SFUs, consistent with Figure 3.

Q2 (compute-bound with lower-precision types): We do not cast to FP16/BF16: inputs and accumulation are FP32 and TF32 rounds only the tl.dot inputs. On numerical impact (new experiment, n=32,768n=32{,}768): relative to the same kernel in exact FP32 arithmetic, TF32 perturbs each density estimate by 3.2%3.2\% on average; re-drawing the full nn-point training set perturbs the same estimates by 7.2%7.2\% on average, so the hardware effect is within the estimator's sampling noise.

Q3 (Laplace surrogate vs. full SD-KDE on non-Gaussian, heavy-tailed distributions): Full SD-KDE stays robust on heavy tails, while the Laplace surrogate is the most accurate at small nn but improves less at large nn, so we recommend full SD-KDE when tails are unknown. We evaluated all three estimators on a 1-D two-component Student-t3t_3 mixture, which has infinite fourth moment, using the Silverman bandwidth and reporting integrated squared error against the true density over 5 seeds (×103\times 10^3, mean ±\pm std):

nn KDE Flash-SD-KDE Flash-Laplace-KDE
1,024 10.02±1.4810.02 \pm 1.48 5.35±1.155.35 \pm 1.15 2.95±0.84\mathbf{2.95 \pm 0.84}
4,096 5.71±0.245.71 \pm 0.24 2.32±0.162.32 \pm 0.16 1.38±0.16\mathbf{1.38 \pm 0.16}
16,384 2.88±0.252.88 \pm 0.25 0.94±0.13\mathbf{0.94 \pm 0.13} 1.23±0.131.23 \pm 0.13

W2 (negative density values): On the heavy-tailed benchmark above, a worst case for the signed correction, the integrated negative mass of Flash-Laplace-KDE is at most 2.2×10−42.2\times10^{-4} (at n=1,024n=1{,}024) and decreases in nn over the first three sizes (8.6×10−58.6\times10^{-5} at n=16,384n=16{,}384).

Reviewer 3kmd · CommentOpenReview ↗

Thank you to the authors for your rebuttal. I’m already positive on the paper and hence I’ll keep my score.

Reviewer 39iHOpenReview ↗
Rating
3/6
Confidence
3/5
Quality
2/4
Clarity
2/4
Significance
2/4
Originality
3/4
Contribution type
general
Ethical concerns
NO or VERY MINOR ethics concerns only
Read review
Summary

This paper accelerates score-debiased kernel density estimation (SD-KDE) by reformulating its computation as Tensor Core–friendly matrix multiplications (GEMMs) combined with lightweight elementwise operations. The approach avoids storing large pairwise interaction matrices through streaming accumulation, substantially reducing computational overhead. In 16-dimensional experiments, the optimized implementation achieves up to 47× speedup over a strong PyTorch SD-KDE baseline and 3,300× speedup over scikit-learn KDE, enabling SD-KDE to scale to ~1 million training samples and ~131k query points in 2.3 seconds on a single GPU.

Strengths and weaknesses
  • The reformulation into GEMM plus streaming accumulation optimization is interesting and well aligned with modern GPU architectures
  • The reported speedups are outstanding: up to 47× over Torch SD-KDE, over 3300× over scikit-learn, million-scale SD-KDE in only 2.3 seconds on a single GPU.
  • The work could make SD-KDE practical for a wide range of real-world challenging applications
Questions
  • The use of Tensor Cores is not sufficiently explained. Because Tensor Cores are designed for GEMM and are already supported by cuBLAS, it is unclear what makes the proposed implementation different from a standard GEMM-based implementation.
  • it is difficult to connect the work to Tensor Core since CUDA core is also applicable
  • The implementation relies on Tensor Cores with TF32 precision (19 bit), what is the impact of reduced numerical precision on SD-KDE accuracy?
  • Can you show the Roofline analysis result?
Limitations
  • Numerical accuracy is insufficiently discussed when using the Tensor Core
  • It would be stronger if it demonstrated benefits in broader ML applications, e..g diffusion models, uncertainty estimation ......
Final justification

I will keep my original rating, although some of my concerns have been partially addressed.

Formatting concerns

N/A

3 comments
Authors · CommentOpenReview ↗

Rebuttal to Reviewer 39iH

Thank you for your detailed review. To address your questions we ran several new experiments on the same RTX A6000 GPU used in the paper.

Q1 (what is different from a standard cuBLAS GEMM implementation): The difference is not the GEMM but the dataflow: separate GPU kernels communicate through global memory, so a cuBLAS-based implementation writes and reads the n×nn \times n Gram and kernel matrices through it, ≈16\approx 16 GB ≈21\approx 21 ms at 770 GB/s for n=32,768n=32{,}768, no matter how fast the GEMMs run. Our kernel fuses the norms, exp, and both accumulations into the GEMM tile loop, so these intermediates never leave registers. The ladder isolates what each idea contributes (ntrain=32,768n_{\text{train}}=32{,}768, ntest=4,096n_{\text{test}}=4{,}096, d=16d=16):

# Implementation Idea added Total (ms) Cumulative speedup
1 PyTorch eager with TF32 Tensor Cores (baseline) 113.3 1×1\times
2 Our GEMM formulation, un-tiled Tensor-Core GEMM reformulation alone; n2n^2 intermediates still round-trip HBM 100.4 1.1×1.1\times
3 torch.compile fuses all elementwise chains; still materializes one n2n^2 buffer for cuBLAS 34.3 3.3×3.3\times
4 Our streamed Triton kernel, Tensor Cores disabled (Table 5) full fusion + streaming: n2n^2 tiles never leave registers/shared memory 10.5 10.8×10.8\times
5 Flash-SD-KDE (Table 1; row 4 + Tensor-Core tiles) GEMM tiles execute on Tensor Cores 2.4 47×\mathbf{47\times}

Q2 (CUDA cores are also applicable): Agreed, and paper Table 5 measures precisely this ablation: the identical streamed kernel with Tensor-Core tiling disabled (FP32 CUDA-core tl.dot) is 4.94×4.94\times slower at n=32,768n=32{,}768 and 4.80×4.80\times at n=65,536n=65{,}536.

Q3/Limitation 1(impact of TF32 precision): TF32 rounds only the tl.dot inputs to a 10-bit mantissa, storage and accumulation remain FP32, and no data is cast to FP16. We compared the TF32 against an FP32 reference of the full SD-KDE pipeline at d=16d=16, ntrain=32,768n_{\text{train}}=32{,}768, ntest=4,096n_{\text{test}}=4{,}096:

Variant Max rel. err. vs FP32 Mean rel. err. vs FP32
Flash-SD-KDE, TF32 8.9×10−28.9\times10^{-2} 3.2×10−23.2\times10^{-2}

TF32 perturbs each density estimate by 3.23.2 percentage on average; re-drawing the full nn-point training set perturbs the same estimates by 7.27.2 percentage on average, so the hardware effect is within the estimator's sampling noise, and the debiased sample positions move by at most 1.1%1.1\% of hh.

Q4 (roofline analysis): Section 4.1 contains the quantitative roofline analysis. Summary for the score kernel at n=32,768n=32{,}768 on the A6000:

Quantity Value
Arithmetic intensity, tile model 72 FLOPs/byte
Arithmetic intensity, Nsight-measured ≈95\approx 95 FLOPs/byte
FP32 roofline knee ≈50\approx 50 FLOPs/byte
TF32 Tensor-Core roofline knee ≈200\approx 200 FLOPs/byte
Nsight "Speed of Light" SM / L1 throughput ≈68%\approx 68\% / ≈90%\approx 90\%
Sustained fraction of absolute TC peak (Fig. 3, n≥131n \geq 131k) 25 to 27% (≈40\approx 40 TFLOP/s)

The kernel sits above the FP32 roof and below the pure-TC balance point, exactly as expected for a mixed GEMM + FP32-scalar workload; this is why we stopped low-level tuning at ≈68%\approx 68\% SM throughput.

Limitation (broader ML applications): The paper evaluates Flash-SD-KDE on three real, non-synthetic workloads (Appendix A.7): Statlog Shuttle (recovers 807/879 true outliers vs. 610 for the best published baseline, in 0.60 s), ALOI (0.09 s), and KDD-Cup 99 HTTP with n=620,098n=620{,}098 (ROC-AUC 0.92 in 7.27 s). We also note (Appendix C.4) that the same kernels are drop-in for KDE-primitive pipelines such as KDE-based attention approximations and embedding-space OOD scoring. Applications such as diffusion-model components were considered in the original SD-KDE paper, but given the small scale of those experiments, we don't think Flash-SD-KDE would unlock new capabilities at that scale. However, larger scale diffusion-model experiments is an interesting avenue for future work.

Reviewer 39iH · CommentOpenReview ↗
  • If using cuBLAS, global memory can also be used to exchange data between kernels, which is the same as your method. Do you mean your method can fuse the kernels while hiding the kernel communication latency?
  • "so these intermediates never leave registers". Do you mean in-register computation? If using Tensor Cores, the computations are performed on the Tensor Core units without using CUDA cores with registers, in my view.
  • It is unclear why your method performs better and where the outstanding speedup (e.g., 47×) comes from.
  • Roofline results looks acceptable
Authors · CommentOpenReview ↗

Author Reply to Rebuttal Comment

Thank you for the follow-up. The key distinction is indeed fusion, but we eliminate, rather than hide, the dominant inter-kernel communication.

In a conventional cuBLAS pipeline, G=XX⊤G = XX^\top is written to HBM; a separate kernel reads GG, computes and writes Φ\Phi; and the subsequent GEMM reads Φ\Phi again. Our streamed kernel computes one GG tile using Tensor Cores, immediately applies the distance and exponential operations, consumes the resulting Φ\Phi tile in both the row reduction and the ΦX\Phi X accumulation, and then discards it. Thus, the n2n^2 Gram and kernel intermediates are never materialized in global memory.

By ``remain in registers/shared memory,'' we mean the residency of the tile data, not the arithmetic unit performing the multiplication. The matrix multiplication executes on Tensor Cores using operands and accumulators held on-chip, while the norms, exponentials, and reductions execute on FP32 ALUs and SFUs.

The 47.2×47.2\times end-to-end speedup decomposes as follows at n=32,768n = 32{,}768. The eager PyTorch baseline, which already uses TF32 Tensor Cores, takes 113.3 ms113.3\,\mathrm{ms}. Fusion and streaming alone, with Tensor Cores disabled, reduce this to 10.5 ms10.5\,\mathrm{ms}, a 10.8×10.8\times speedup. Enabling Tensor-Core tiles further reduces the runtime to 2.4 ms2.4\,\mathrm{ms}, an additional 4.4×4.4\times speedup. Thus, most of the gain comes from eliminating the n2n^2 HBM traffic, while Tensor Cores provide the remaining throughput improvement.

From OpenReview, CC BY 4.0. Authors as signed there; shown unedited.

Missing a submission?

Loading the discussion…