Skip to content

Short-circuit index_put with a statically-empty index - #4641

Open
apbose wants to merge 1 commit into
mainfrom
abose/fix-index-put-empty-index-dgx-spark
Open

Short-circuit index_put with a statically-empty index#4641
apbose wants to merge 1 commit into
mainfrom
abose/fix-index-put-empty-index-dgx-spark

Conversation

@apbose

@apbose apbose commented Aug 29, 2026

Copy link
Copy Markdown
Collaborator

Description

An empty index means no positions to scatter into, so index_put is a no-op. Building the scatter path anyway (reshaping an index tensor to a shape containing a 0) trips a TensorRT-internal squeezeDims assertion at build time on DGX Spark (GB10, SM 12.1) -- Error Code 2, "Assertion inputDims != nullptr failed" in validationUtils.cpp. Other platforms don't hit it (verified: passes on H100/A100/GB200-family/ORIN_IGX), but the operation is a no-op regardless of platform, so avoid building it at all.

Related but distinct from #4621 (dynamic-index broadcast bug in the same converter) -- different trigger condition, different TRT error, different fix location.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • I have performed a self-review of my own code
  • New and existing unit tests pass locally with my changes

An empty index means no positions to scatter into, so index_put is a
no-op. Building the scatter path anyway (reshaping an index tensor to
a shape containing a 0) trips a TensorRT-internal squeezeDims
assertion at build time on DGX Spark (GB10, SM 12.1) -- Error Code 2,
"Assertion inputDims != nullptr failed" in validationUtils.cpp.
Other platforms don't hit it, but the operation is a no-op regardless
of platform, so avoid building it at all.
@meta-cla meta-cla Bot added the cla signed label Aug 29, 2026
@github-actions github-actions Bot added component: conversion Issues re: Conversion stage component: core Issues re: The core compiler component: converters Issues re: Specific op converters component: api [Python] Issues re: Python API component: dynamo Issues relating to the `torch.compile` or `torch._dynamo.export` paths labels Aug 29, 2026
@github-actions
github-actions Bot requested a review from cehongwang August 29, 2026 00:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla signed component: api [Python] Issues re: Python API component: conversion Issues re: Conversion stage component: converters Issues re: Specific op converters component: core Issues re: The core compiler component: dynamo Issues relating to the `torch.compile` or `torch._dynamo.export` paths

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant