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

[VL] Pretty log native fallback reason #4494

Merged
merged 7 commits into from
Jan 25, 2024

Conversation

Yohahaha
Copy link
Contributor

@Yohahaha Yohahaha commented Jan 23, 2024

What changes were proposed in this pull request?

Introduce two new macros in native to enhance validation log: LOG_VALIDATION_MSG_FROM_EXCEPTION, LOG_VALIDATION_MSG, then help developer check root cause easily.

Before:

(4) SortAggregate: Found unsupported data type in aggregation expression,MapType(StringType,IntegerType,true), BooleanType
(9) SortAggregate: Found unsupported data type in aggregation expression,MapType(StringType,IntegerType,true), BooleanType

(4) SortAggregate: native check failure:native validation failed due to: Validation failed for input type in AggregateRel function due to:Substrait type signature conversion to Velox type not supported for list., native validation failed due to: Validation failed for ProjectRel input.
(9) SortAggregate: native check failure:native validation failed due to: Validation failed for input type in AggregateRel function due to:Substrait type signature conversion to Velox type not supported for list., native validation failed due to: Validation failed for ProjectRel input.

After:

(4) SortAggregate: Found unsupported data type in aggregation expression: first#18:MapType(StringType,IntegerType,true)
(9) SortAggregate: Found unsupported data type in aggregation expression: first(map#2)()#15:MapType(StringType,IntegerType,true)

(4) SortAggregate: Native validation failed:
  Validation failed due to exception caught at file:SubstraitToVeloxPlanValidator.cc line:962 function:validateAggRelFunctionType, thrown from file:VeloxSubstraitSignature.cc line:171 function:fromSubstraitSignature, reason:Substrait type signature conversion to Velox type not supported for list.
  Validation failed at file:SubstraitToVeloxPlanValidator.cc, line:769, function:validate, reason:ProjectRel input
(9) SortAggregate: Native validation failed:
  Validation failed due to exception caught at file:SubstraitToVeloxPlanValidator.cc line:962 function:validateAggRelFunctionType, thrown from file:VeloxSubstraitSignature.cc line:171 function:fromSubstraitSignature, reason:Substrait type signature conversion to Velox type not supported for list.
  Validation failed at file:SubstraitToVeloxPlanValidator.cc, line:769, function:validate, reason:ProjectRel input

Copy link

Thanks for opening a pull request!

Could you open an issue for this pull request on Github Issues?

https://github.com/oap-project/gluten/issues

Then could you also rename commit message and pull request title in the following format?

[GLUTEN-${ISSUES_ID}][COMPONENT]feat/fix: ${detailed message}

See also:

Copy link

Run Gluten Clickhouse CI

2 similar comments
Copy link

Run Gluten Clickhouse CI

Copy link

Run Gluten Clickhouse CI

Copy link

Run Gluten Clickhouse CI

@Yohahaha
Copy link
Contributor Author

could someone help review and rerun failed CI jobs? I have checked these failed CI jobs all due to network issue. cc @PHILO-HE @ulysses-you

Copy link
Contributor

@PHILO-HE PHILO-HE left a comment

Choose a reason for hiding this comment

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

Thanks for your work! Just two trivial comments.

cpp/velox/substrait/SubstraitToVeloxPlanValidator.cc Outdated Show resolved Hide resolved
@@ -29,6 +29,20 @@
namespace gluten {

namespace {
#define LOG_VALIDATION_MSG_FROM_EXCEPTION(err) \
logValidateMsg(fmt::format( \
"Validation failed due to exception caught at file:{} line:{} function:{}, thrown from file:{} line:{} function:{} reason:{}", \
Copy link
Contributor

Choose a reason for hiding this comment

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

It may be better to contain exception position if debug is enabled? Ditto for LOG_VALIDATION_MSG.

Copy link
Contributor Author

@Yohahaha Yohahaha Jan 24, 2024

Choose a reason for hiding this comment

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

I prefer keeping these information to help us quickly find root fallback reason, we may not ask customer re-run with debug mode enabled, customer's resources and patience not always enough.

Copy link

Run Gluten Clickhouse CI

@@ -42,7 +42,7 @@ object ValidationResult {
ok
} else {
val fallbackInfo = info.getFallbackInfo.asScala
.mkString("native check failure:", ", ", "")
.mkString("Native validation failed:\n ", "\n ", "")
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: remove blank after '\n'

Copy link
Contributor Author

Choose a reason for hiding this comment

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

these two blanks represent next line's indent.

(4) SortAggregate: Native validation failed:
  Validation failed xxx
  Validation failed xxx
(9) SortAggregate: Native validation failed:
  Validation failed xxx
  Validation failed xxx

(4) SortAggregate: Native validation failed:
Validation failed xxx
Validation failed xxx
(9) SortAggregate: Native validation failed:
Validation failed xxx
Validation failed xxx

@PHILO-HE
Copy link
Contributor

Validation failed due to exception caught at file:/root/oap-gluten/cpp/velox/substrait/SubstraitToVeloxPlanValidator.cc line:962 function:validateAggRelFunctionType, thrown from file:/root/oap-gluten/cpp/velox/substrait/VeloxSubstraitSignature.cc line:171 function:fromSubstraitSignature reason:Substrait type signature conversion to Velox type not supported for list.

Can we just leave a file name instead of full file path? We should make it brief, as well as informative. BTW, it may look better to clearly separate reason part from thrown from xxxx part, e.g. "thrown from xxx. Reason: xxx."

Copy link

Run Gluten Clickhouse CI

@Yohahaha
Copy link
Contributor Author

Validation failed due to exception caught at file:/root/oap-gluten/cpp/velox/substrait/SubstraitToVeloxPlanValidator.cc line:962 function:validateAggRelFunctionType, thrown from file:/root/oap-gluten/cpp/velox/substrait/VeloxSubstraitSignature.cc line:171 function:fromSubstraitSignature reason:Substrait type signature conversion to Velox type not supported for list.

Can we just leave a file name instead of full file path? We should make it brief, as well as informative. BTW, it may look better to clearly separate reason part from thrown from xxxx part, e.g. "thrown from xxx. Reason: xxx."

ok.

Copy link
Contributor

@PHILO-HE PHILO-HE left a comment

Choose a reason for hiding this comment

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

Thanks!

Copy link
Contributor

@ulysses-you ulysses-you left a comment

Choose a reason for hiding this comment

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

thank you @Yohahaha

@PHILO-HE PHILO-HE merged commit 4e33e0e into apache:main Jan 25, 2024
20 checks passed
@Yohahaha Yohahaha deleted the fix-native-fallback-reason branch January 25, 2024 06:02
@GlutenPerfBot
Copy link
Contributor

===== Performance report for TPCH SF2000 with Velox backend, for reference only ====

query log/native_4494_time.csv log/native_master_01_24_2024_7df896bf2_time.csv difference percentage
q1 33.10 31.79 -1.307 96.05%
q2 23.54 23.75 0.210 100.89%
q3 36.98 37.77 0.781 102.11%
q4 37.76 37.98 0.227 100.60%
q5 68.72 66.72 -2.007 97.08%
q6 5.42 6.87 1.448 126.71%
q7 81.35 82.42 1.072 101.32%
q8 84.73 83.45 -1.283 98.49%
q9 123.82 121.64 -2.180 98.24%
q10 41.68 44.56 2.881 106.91%
q11 20.11 20.08 -0.039 99.81%
q12 26.23 28.81 2.584 109.85%
q13 44.70 44.54 -0.166 99.63%
q14 21.01 15.67 -5.337 74.60%
q15 26.60 27.54 0.941 103.54%
q16 15.10 14.10 -1.006 93.34%
q17 101.04 99.75 -1.288 98.73%
q18 145.28 144.42 -0.860 99.41%
q19 13.78 14.16 0.378 102.75%
q20 26.53 26.38 -0.152 99.43%
q21 222.85 224.22 1.369 100.61%
q22 13.55 13.45 -0.092 99.32%
total 1213.87 1210.05 -3.824 99.69%

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.

4 participants