Skip to content

Conversation

@leimao
Copy link

@leimao leimao commented Nov 18, 2025

I believe there are some bugs due to typo in programming.

@meta-cla meta-cla bot added the cla signed label Nov 18, 2025
@github-actions github-actions bot added the component: api [C++] Issues re: C++ API label Nov 18, 2025
@github-actions github-actions bot requested a review from narendasan November 18, 2025 04:54
@github-actions github-actions bot added component: lowering Issues re: The lowering / preprocessing passes component: core Issues re: The core compiler labels Nov 18, 2025
}
}

DataType::DataType(c10::ScalarType t) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

These are type constructors not direct translators

TORCHTRT_CHECK(
t == at::MemoryFormat::Contiguous || t == at::MemoryFormat::ChannelsLast,
"Tensor format is unsupported (" << t << ")");

Copy link
Collaborator

Choose a reason for hiding this comment

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

Same thing here, value is held by a TensorFormat object

Copy link
Author

Choose a reason for hiding this comment

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

I misread this one. For the purpose of clarity, I think we should use m prefix for object member variables. Will revert these.

@narendasan
Copy link
Collaborator

@leimao thanks for the PR. For the changes to the TS C++ API, these are not bugs. We define a set of wrapped enums that abstract the TRT and PyTorch versions. This makes it easier to write code that may mix the two APIs arbitrarily.

Also as with FX, we are strongly pushing people to use Dynamo + AOTInductor to replace TorchScript as it is now deprecated in PyTorch and will be removed in PyTorch 2.14

@leimao
Copy link
Author

leimao commented Nov 18, 2025

@leimao thanks for the PR. For the changes to the TS C++ API, these are not bugs. We define a set of wrapped enums that abstract the TRT and PyTorch versions. This makes it easier to write code that may mix the two APIs arbitrarily.

Also as with FX, we are strongly pushing people to use Dynamo + AOTInductor to replace TorchScript as it is now deprecated in PyTorch and will be removed in PyTorch 2.14

@narendasan I believe there is still a bug, please review again. Thanks.

[](Stack& stack) {
auto attn_mask = pop(stack).to<at::Tensor>();
if (attn_mask.scalar_type() == at::kBool) {
attn_mask = attn_mask;
Copy link
Author

Choose a reason for hiding this comment

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

This one is unnecessary and is very confusing.

switch (t) {
case at::MemoryFormat::ChannelsLast:
value = TensorFormat::kChannelsLast;
break;
Copy link
Author

Choose a reason for hiding this comment

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

This one fixes an oversight of the implementation.

Copy link
Collaborator

@narendasan narendasan left a comment

Choose a reason for hiding this comment

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

LGTM, Would reiterate again that the torchscript frontend is in maintenance mode so unless there are bugs we likely will not change the implementation much. But we are highly interested in collecting reasons why Dynamo isnt working for your use case if thats the reason you are using TS so we can work to get those gaps closed prior to torchscript being removed

@leimao
Copy link
Author

leimao commented Nov 18, 2025

The test failures seems to be irrelevant to my change. Some warnings were treated as errors by compiler flags.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla signed component: api [C++] Issues re: C++ API component: core Issues re: The core compiler component: lowering Issues re: The lowering / preprocessing passes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants