Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tile dynamic dim #3085

Merged
merged 1 commit into from
Aug 29, 2024
Merged

tile dynamic dim #3085

merged 1 commit into from
Aug 29, 2024

Conversation

apbose
Copy link
Collaborator

@apbose apbose commented Aug 14, 2024

No description provided.

@apbose apbose requested a review from peri044 August 14, 2024 06:16
@github-actions github-actions bot added component: tests Issues re: Tests component: conversion Issues re: Conversion stage 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 14, 2024
@github-actions github-actions bot requested a review from gs-olive August 14, 2024 06:16
shapes = [i * j for i, j in zip(input.shape, dims)]
layer = ctx.net.add_slice(input, tuple(starts), tuple(shapes), tuple(strides))
else:
shapes = None
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should shapes be a list here ?

input, start=trt.Dims(), shape=trt.Dims(), stride=trt.Dims()
)
layer.set_input(1, tuple(starts))
layer.set_input(2, tuple(shapes))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like we are setting a list of ITensors as a second input. But shouldn't the second input be an ITensor (which is the concatenated output of these shapes ) ? or both of them work ?

((2,), (3,), (6,), (2, 2)),
((2,), (3,), (6,), (0, 2)),
# 2d cases
((3, 1), (3, 1), (6, 1), (0,)),
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is tiling with dims = (0,) same as tiling with (1,) ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tiling with dims = (0,) results in that particular dimension as 0 in the tiled tensor. In the above case though it prepends -1 resulting in dims being (-1, 0) post which the dynamic input tensor is tiled

@apbose apbose requested a review from peri044 August 27, 2024 15:44
@peri044 peri044 merged commit ffa4f64 into main Aug 29, 2024
67 checks passed
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: dynamo Issues relating to the `torch.compile` or `torch._dynamo.export` paths component: tests Issues re: Tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants