Skip to content

Conversation

@cccxinli
Copy link
Contributor

This pr fix the wrong check for tuple node in #18163

@ysh329
Copy link
Contributor

ysh329 commented Jul 30, 2025

We noticed that one CI job has been running for a very long time—17 hours since yesterday. Is this normal?

cc @Hzfengsy @MasterJH5574

Looks like it's stuck on the last test, or does this job usually take this long?

[2025-07-29T10:25:53.581Z] PASSED

[2025-07-29T10:25:53.581Z] tests/python/relax/test_transform_few_shot_tuning.py::test_funcs[False-MatMul] 2025-07-29 10:25:53 [INFO] LocalBuilder: max_workers = 16

[2025-07-29T10:25:57.744Z] PASSED

[2025-07-29T10:25:57.745Z] tests/python/relax/test_transform_few_shot_tuning.py::test_funcs[False-Fuse_Mean_Cast1] 2025-07-29 10:25:57 [INFO] LocalBuilder: max_workers = 16

[2025-07-29T10:26:01.010Z] PASSED

[2025-07-29T10:26:01.010Z] tests/python/relax/test_transform_few_shot_tuning.py::test_funcs[False-Module] 2025-07-29 10:26:00 [INFO] LocalBuilder: max_workers = 16

[2025-07-29T10:26:06.253Z] PASSED

[2025-07-29T10:26:06.253Z] tests/python/relax/test_transform_few_shot_tuning.py::test_funcs[True-Softmax] 2025-07-29 10:26:06 [INFO] LocalBuilder: max_workers = 16

@cccxinli
Copy link
Contributor Author

Hi @Hzfengsy , Sorry I did a wrong check for tuple node in #18163 . This pr fix the bug. Please take a moment to review it when you have time. Thank you.

@ysh329 ysh329 requested a review from Copilot July 31, 2025 11:31
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes an incorrect check for tuple nodes in the FunctionCreator class within the fuse_ops transformation. The issue was that the code was checking for tuple struct info before properly handling the tuple node case.

  • Reorders the tuple checking logic to properly handle tuple nodes before checking struct info
  • Moves the partially_used_tuple_params_.erase() call to execute after tuple processing

Comment on lines 430 to 432
if (arg.as<TupleNode>()) {
const Tuple& tup_args = Downcast<Tuple>(arg);
for (const Expr& tup_arg : tup_args->fields) {
Copy link

Copilot AI Jul 31, 2025

Choose a reason for hiding this comment

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

The condition arg.as<TupleNode>() only checks if the argument is a TupleNode, but the subsequent code unconditionally downcasts to Tuple. This could cause a runtime error if the argument has TupleStructInfo but is not actually a TupleNode. Consider using if (auto tuple = arg.as<TupleNode>()) and use the tuple variable directly.

Suggested change
if (arg.as<TupleNode>()) {
const Tuple& tup_args = Downcast<Tuple>(arg);
for (const Expr& tup_arg : tup_args->fields) {
if (auto tuple = arg.as<TupleNode>()) {
for (const Expr& tup_arg : tuple->fields) {

Copilot uses AI. Check for mistakes.
@tqchen tqchen merged commit 454012f into apache:main Aug 1, 2025
10 checks passed
ShiboXing pushed a commit to ShiboXing/tvm that referenced this pull request Aug 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants