You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@gluten.apache.org by "jinchengchenghh (via GitHub)" <gi...@apache.org> on 2024/12/31 02:50:06 UTC
[PR] [GLUTEN-8379][VL] Support query trace [incubator-gluten]
jinchengchenghh opened a new pull request, #8380:
URL: https://github.com/apache/incubator-gluten/pull/8380
## What changes were proposed in this pull request?
(Please fill in changes proposed in this fix)
(Fixes: \#ISSUE-ID)
## How was this patch tested?
(Please explain how this patch was tested. E.g. unit tests, integration tests, manual tests)
(If this patch involves UI changes, please attach a screenshot; otherwise, remove this)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org
Re: [PR] [GLUTEN-8379][VL] Support query trace [incubator-gluten]
Posted by "duanmeng (via GitHub)" <gi...@apache.org>.
duanmeng commented on PR #8380:
URL: https://github.com/apache/incubator-gluten/pull/8380#issuecomment-2598205558
> The GenericBenchmark is frequently used by us CC @JkSelf , it is really usefully for debug in cpp side, we can use vscode to do step-by-step debug. And query trace is widely used in Velox to do correctness verification and performance profiling, so I think we need to enable it in Gluten. and with this optimization [#8380 (comment)](https://github.com/apache/incubator-gluten/pull/8380#issuecomment-2594652831), we could drop the ValueStreamNode to ValusNode replace. @zhztheplayer
As discussed with @jinchengchenghh offline, we could add simple `ValueStreamNode` serde methods that serialize only `id` and `output type` and create a `ValueStreamNode` with empty `ResultIterator`. Because we do not need to trace the `ValueStreamNode`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org
Re: [PR] [GLUTEN-8379][VL] Support query trace [incubator-gluten]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #8380:
URL: https://github.com/apache/incubator-gluten/pull/8380#issuecomment-2588913772
Run Gluten ClickHouse CI on ARM
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org
Re: [PR] [GLUTEN-8379][VL] Support query trace [incubator-gluten]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #8380:
URL: https://github.com/apache/incubator-gluten/pull/8380#issuecomment-2601688357
Run Gluten ClickHouse CI on ARM
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org
Re: [PR] [GLUTEN-8379][VL] Support query trace [incubator-gluten]
Posted by "zhli1142015 (via GitHub)" <gi...@apache.org>.
zhli1142015 commented on PR #8380:
URL: https://github.com/apache/incubator-gluten/pull/8380#issuecomment-2568644152
We are also looking into this. I tried it locally but encountered the error below. Would you fix it in your PR?
```
Caused by: org.apache.gluten.exception.GlutenException: Exception: VeloxUserError
Error Source: USER
Error Code: UNSUPPORTED
Reason: ValueStream plan node is not serializable
Retriable: False
Function: serialize
File: /var/git/incubator-gluten/cpp/velox/operators/plannodes/RowVectorStream.h
Line: 136
Stack trace:
# 0 facebook::velox::VeloxException::VeloxException(char const*, unsigned long, char const*, std::basic_string_view<char, std::char_traits<char> >, std::basic_string_view<char, std::char_traits<char> >, std::basic_string_view<char, std::char_traits<char> >, std::basic_string_view<char, std::char_traits<char> >, bool, facebook::velox::VeloxException::Type, std::basic_string_view<char, std::char_traits<char> >)
# 1 void facebook::velox::detail::veloxCheckFail<facebook::velox::VeloxUserError, char const*>(facebook::velox::detail::VeloxCheckFailArgs const&, char const*)
# 2 gluten::ValueStreamNode::serialize() const
# 3 facebook::velox::core::PlanNode::serialize() const
# 4 facebook::velox::core::TopNNode::serialize() const
# 5 facebook::velox::core::PlanNode::serialize() const
# 6 facebook::velox::core::ProjectNode::serialize() const
# 7 facebook::velox::exec::trace::TaskTraceMetadataWriter::write(std::shared_ptr<facebook::velox::core::QueryCtx> const&, std::shared_ptr<facebook::velox::core::PlanNode const> const&)
# 8 facebook::velox::exec::Task::maybeInitTrace()
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org
Re: [PR] [GLUTEN-8379][VL] Support query trace [incubator-gluten]
Posted by "duanmeng (via GitHub)" <gi...@apache.org>.
duanmeng commented on PR #8380:
URL: https://github.com/apache/incubator-gluten/pull/8380#issuecomment-2594652831
@jinchengchenghh It is awesome to support query tracing in gluten. By the way, I am planning to support `PlanNode` serialization without leaf nodes to avoid serializing potential `ValueStreamNode` so that we can support more general query tracing in gluten.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org
Re: [PR] [GLUTEN-8379][VL] Support query trace [incubator-gluten]
Posted by "jinchengchenghh (via GitHub)" <gi...@apache.org>.
jinchengchenghh commented on PR #8380:
URL: https://github.com/apache/incubator-gluten/pull/8380#issuecomment-2599370296
I tried the serialize ValueStreamNode as empty serialization, but failed by deserialization.
The plan node deserialization is registered in velox, but ValueStreamNode exists in gluten, so we cannot do that.
https://github.com/facebookincubator/velox/blob/main/velox/core/PlanNode.cpp#L2716
```
root@sr249:/mnt/DP_disk1/code/velox/build/velox/tool/trace# ./velox_query_replayer --root_dir /tmp/query_trace --task_id Gluten_Stage_0_TID_0_VTID_0 --query_id=query_1 --node_id=7 --summary
WARNING: Logging before InitGoogleLogging() is written to STDERR
I0117 20:08:46.359496 2923199 HiveConnector.cpp:56] Hive connector test-hive created with maximum of 20000 cached file handles.
terminate called after throwing an instance of 'facebook::velox::VeloxUserError'
what(): Exception: VeloxUserError
Error Source: USER
Error Code: INVALID_ARGUMENT
Reason: Deserialization function for class: ValueStreamNode is not registered
Retriable: False
Expression: registry.Has(name)
Function: deserialize
File: /mnt/DP_disk1/code/velox/./velox/common/serialization/Serializable.h
Line: 196
Stack trace:
Stack trace has been disabled. Use --velox_exception_user_stacktrace_enabled=true to enable it
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org
Re: [PR] [GLUTEN-8379][VL] Support query trace [incubator-gluten]
Posted by "zhztheplayer (via GitHub)" <gi...@apache.org>.
zhztheplayer commented on PR #8380:
URL: https://github.com/apache/incubator-gluten/pull/8380#issuecomment-2571904807
> Our benchmark accepts a total velox plan, but query trace can specify the plan node id, it can save the input of any plan node @FelixYBW
Can we consolidate the two functionalities? They sound overlap more or less?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org
Re: [PR] [GLUTEN-8379][VL] Support query trace [incubator-gluten]
Posted by "jinchengchenghh (via GitHub)" <gi...@apache.org>.
jinchengchenghh commented on code in PR #8380:
URL: https://github.com/apache/incubator-gluten/pull/8380#discussion_r1919462583
##########
cpp/velox/compute/WholeStageResultIterator.cc:
##########
@@ -51,6 +51,14 @@ const std::string kWriteIOTime = "writeIOTime";
// others
const std::string kHiveDefaultPartition = "__HIVE_DEFAULT_PARTITION__";
+std::string getQueryId(const std::unordered_map<std::string, std::string>& confMap) {
+ auto it = confMap.find(kQueryTraceQueryId);
+ if (it != confMap.end()) {
+ return it->second;
+ }
+ return "";
+}
+
Review Comment:
Can we uses the applicationId_stageId as the queryId?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org
Re: [PR] [GLUTEN-8379][VL] Support query trace [incubator-gluten]
Posted by "jinchengchenghh (via GitHub)" <gi...@apache.org>.
jinchengchenghh commented on PR #8380:
URL: https://github.com/apache/incubator-gluten/pull/8380#issuecomment-2601185562
Can you help review again? Thanks! @zhztheplayer
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org
Re: [PR] [GLUTEN-8379][VL] Support query trace [incubator-gluten]
Posted by "jinchengchenghh (via GitHub)" <gi...@apache.org>.
jinchengchenghh commented on PR #8380:
URL: https://github.com/apache/incubator-gluten/pull/8380#issuecomment-2568723205
If you don't set the trace config, we won't run into this exception. The exception indicates you could not enable query trace in that case.
Looks like we still have further more work to do to enable query trace in Gluten
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org
Re: [PR] [GLUTEN-8379][VL] Support query trace [incubator-gluten]
Posted by "zhztheplayer (via GitHub)" <gi...@apache.org>.
zhztheplayer commented on code in PR #8380:
URL: https://github.com/apache/incubator-gluten/pull/8380#discussion_r1921724994
##########
shims/common/src/main/scala/org/apache/gluten/config/GlutenConfig.scala:
##########
@@ -2288,4 +2294,48 @@ object GlutenConfig {
.doc("If enabled, gluten will not offload scan when encrypted parquet files are detected")
.booleanConf
.createWithDefault(false)
+
+ val QUERY_TRACE_ENABLED = buildConf("spark.gluten.sql.columnar.backend.velox.queryTraceEnabled")
+ .doc("Enable query tracing flag.")
+ .internal()
+ .booleanConf
+ .createWithDefault(false)
+
+ val QUERY_TRACE_DIR = buildConf("spark.gluten.sql.columnar.backend.velox.queryTraceDir")
+ .doc("Base dir of a query to store tracing data.")
Review Comment:
What happens if one leaves this empty?
##########
docs/developers/QueryTrace.md:
##########
@@ -0,0 +1,175 @@
+---
+layout: page
+title: How To Use Gluten
+nav_order: 1
+parent: Developer Overview
+---
Review Comment:
@jinchengchenghh
nit: Would you update `title` (and perhaps other fields as well) in the header? Thanks.
##########
cpp/velox/compute/WholeStageResultIterator.cc:
##########
@@ -51,6 +51,14 @@ const std::string kWriteIOTime = "writeIOTime";
// others
const std::string kHiveDefaultPartition = "__HIVE_DEFAULT_PARTITION__";
+std::string getQueryId(const std::unordered_map<std::string, std::string>& confMap) {
+ auto it = confMap.find(kQueryTraceQueryId);
+ if (it != confMap.end()) {
+ return it->second;
+ }
+ return "";
+}
+
Review Comment:
> Can we uses the applicationId_stageId as the queryId?
Do we have applicationId passed through JNI? Or could just align it with the [task name](https://github.com/apache/incubator-gluten/blob/b29aa3b9973d28ed03e9840772734dd1f47b3cdd/cpp/velox/compute/WholeStageResultIterator.cc#L87-L91) somehow.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org
Re: [PR] [GLUTEN-8379][VL] Support query trace [incubator-gluten]
Posted by "jinchengchenghh (via GitHub)" <gi...@apache.org>.
jinchengchenghh commented on code in PR #8380:
URL: https://github.com/apache/incubator-gluten/pull/8380#discussion_r1921959505
##########
cpp/velox/compute/WholeStageResultIterator.cc:
##########
@@ -51,6 +51,14 @@ const std::string kWriteIOTime = "writeIOTime";
// others
const std::string kHiveDefaultPartition = "__HIVE_DEFAULT_PARTITION__";
+std::string getQueryId(const std::unordered_map<std::string, std::string>& confMap) {
+ auto it = confMap.find(kQueryTraceQueryId);
+ if (it != confMap.end()) {
+ return it->second;
+ }
+ return "";
+}
+
Review Comment:
Now we don't pass the applicationId
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org
Re: [PR] [GLUTEN-8379][VL] Support query trace [incubator-gluten]
Posted by "zhztheplayer (via GitHub)" <gi...@apache.org>.
zhztheplayer commented on code in PR #8380:
URL: https://github.com/apache/incubator-gluten/pull/8380#discussion_r1917781901
##########
cpp/velox/substrait/SubstraitToVeloxPlan.cc:
##########
@@ -1206,6 +1207,24 @@ core::PlanNodePtr SubstraitToVeloxPlanConverter::constructValueStreamNode(
return node;
}
+core::PlanNodePtr SubstraitToVeloxPlanConverter::constructValuesNode(
+ const ::substrait::ReadRel& readRel,
+ int32_t streamIdx) {
+ std::vector<RowVectorPtr> values;
+ VELOX_CHECK_LT(streamIdx, inputIters_.size(), "Could not find stream index {} in input iterator list.", streamIdx);
+ const auto iterator = inputIters_[streamIdx];
+ while (iterator->hasNext()) {
+ auto cb = VeloxColumnarBatch::from(defaultLeafVeloxMemoryPool().get(), iterator->next());
Review Comment:
Is the memory managed by Spark? Given that `defaultLeafVeloxMemoryPool` is global.
##########
cpp/velox/compute/WholeStageResultIterator.cc:
##########
@@ -51,6 +51,14 @@ const std::string kWriteIOTime = "writeIOTime";
// others
const std::string kHiveDefaultPartition = "__HIVE_DEFAULT_PARTITION__";
+std::string getQueryId(const std::unordered_map<std::string, std::string>& confMap) {
+ auto it = confMap.find(kQueryTraceQueryId);
+ if (it != confMap.end()) {
+ return it->second;
+ }
+ return "";
+}
+
Review Comment:
A little bit confused with the empty query ID. Can we always give a meaningful ID to Velox?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org
Re: [PR] [GLUTEN-8379][VL] Support query trace [incubator-gluten]
Posted by "zhztheplayer (via GitHub)" <gi...@apache.org>.
zhztheplayer commented on code in PR #8380:
URL: https://github.com/apache/incubator-gluten/pull/8380#discussion_r1917786669
##########
docs/developers/QueryTrace.md:
##########
@@ -0,0 +1,175 @@
+---
+layout: page
+title: How To Use Gluten
+nav_order: 1
+parent: Developer Overview
+---
Review Comment:
The header needs to update.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org
Re: [PR] [GLUTEN-8379][VL] Support query trace [incubator-gluten]
Posted by "jinchengchenghh (via GitHub)" <gi...@apache.org>.
jinchengchenghh commented on code in PR #8380:
URL: https://github.com/apache/incubator-gluten/pull/8380#discussion_r1919451701
##########
cpp/velox/substrait/SubstraitToVeloxPlan.cc:
##########
@@ -1206,6 +1207,24 @@ core::PlanNodePtr SubstraitToVeloxPlanConverter::constructValueStreamNode(
return node;
}
+core::PlanNodePtr SubstraitToVeloxPlanConverter::constructValuesNode(
+ const ::substrait::ReadRel& readRel,
+ int32_t streamIdx) {
+ std::vector<RowVectorPtr> values;
+ VELOX_CHECK_LT(streamIdx, inputIters_.size(), "Could not find stream index {} in input iterator list.", streamIdx);
+ const auto iterator = inputIters_[streamIdx];
+ while (iterator->hasNext()) {
+ auto cb = VeloxColumnarBatch::from(defaultLeafVeloxMemoryPool().get(), iterator->next());
Review Comment:
This is only used in benchmark, so we don't need to track it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org
Re: [PR] [GLUTEN-8379][VL] Support query trace [incubator-gluten]
Posted by "FelixYBW (via GitHub)" <gi...@apache.org>.
FelixYBW commented on PR #8380:
URL: https://github.com/apache/incubator-gluten/pull/8380#issuecomment-2606078393
Thank you, Chengcheng for your effort!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org
Re: [PR] [GLUTEN-8379][VL] Support query trace [incubator-gluten]
Posted by "Yohahaha (via GitHub)" <gi...@apache.org>.
Yohahaha commented on code in PR #8380:
URL: https://github.com/apache/incubator-gluten/pull/8380#discussion_r1912593678
##########
cpp/velox/compute/WholeStageResultIterator.cc:
##########
@@ -558,6 +558,18 @@ std::unordered_map<std::string, std::string> WholeStageResultIterator::getQueryC
configs[velox::core::QueryConfig::kSparkLegacyDateFormatter] = "false";
}
+ const auto setIfExists = [&](const std::string& glutenKey, const std::string& veloxKey) {
Review Comment:
if this func is common, should we declare it as static member function?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org
Re: [PR] [GLUTEN-8379][VL] Support query trace [incubator-gluten]
Posted by "zhli1142015 (via GitHub)" <gi...@apache.org>.
zhli1142015 commented on PR #8380:
URL: https://github.com/apache/incubator-gluten/pull/8380#issuecomment-2568720117
And we also need to register spark fucntions in `velox_query_replayer`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org
Re: [PR] [GLUTEN-8379][VL] Support query trace [incubator-gluten]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #8380:
URL: https://github.com/apache/incubator-gluten/pull/8380#issuecomment-2591511761
Run Gluten ClickHouse CI on ARM
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org
Re: [PR] [GLUTEN-8379][VL] Support query trace [incubator-gluten]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #8380:
URL: https://github.com/apache/incubator-gluten/pull/8380#issuecomment-2592820919
Run Gluten ClickHouse CI on ARM
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org
Re: [PR] [GLUTEN-8379][VL] Support query trace [incubator-gluten]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #8380:
URL: https://github.com/apache/incubator-gluten/pull/8380#issuecomment-2594281494
Run Gluten ClickHouse CI on ARM
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org
Re: [PR] [GLUTEN-8379][VL] Support query trace [incubator-gluten]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #8380:
URL: https://github.com/apache/incubator-gluten/pull/8380#issuecomment-2597257265
Run Gluten ClickHouse CI on ARM
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org
Re: [PR] [GLUTEN-8379][VL] Support query trace [incubator-gluten]
Posted by "zhli1142015 (via GitHub)" <gi...@apache.org>.
zhli1142015 commented on PR #8380:
URL: https://github.com/apache/incubator-gluten/pull/8380#issuecomment-2568719752
I think we might need to convert the exception below into a warning log to tolerate the issue you mentioned, where only some operators are supported.
https://github.com/facebookincubator/velox/blob/9da5fa7ee803540e330bc626a57388c9cbcad1b3/velox/exec/Operator.cpp#L130
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org
Re: [PR] [GLUTEN-8379][VL] Support query trace [incubator-gluten]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #8380:
URL: https://github.com/apache/incubator-gluten/pull/8380#issuecomment-2571844914
Run Gluten Clickhouse CI on x86
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org
Re: [PR] [GLUTEN-8379][VL] Support query trace [incubator-gluten]
Posted by "jinchengchenghh (via GitHub)" <gi...@apache.org>.
jinchengchenghh commented on code in PR #8380:
URL: https://github.com/apache/incubator-gluten/pull/8380#discussion_r1923239106
##########
shims/common/src/main/scala/org/apache/gluten/config/GlutenConfig.scala:
##########
@@ -2288,4 +2294,48 @@ object GlutenConfig {
.doc("If enabled, gluten will not offload scan when encrypted parquet files are detected")
.booleanConf
.createWithDefault(false)
+
+ val QUERY_TRACE_ENABLED = buildConf("spark.gluten.sql.columnar.backend.velox.queryTraceEnabled")
+ .doc("Enable query tracing flag.")
+ .internal()
+ .booleanConf
+ .createWithDefault(false)
+
+ val QUERY_TRACE_DIR = buildConf("spark.gluten.sql.columnar.backend.velox.queryTraceDir")
+ .doc("Base dir of a query to store tracing data.")
Review Comment:
This config is only used in internal, user will not set it by this config name, because we need to enable query trace in benchmark, so user set it by FLAGS_XX in benchmark
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org
Re: [PR] [GLUTEN-8379][VL] Support query trace [incubator-gluten]
Posted by "zhztheplayer (via GitHub)" <gi...@apache.org>.
zhztheplayer commented on code in PR #8380:
URL: https://github.com/apache/incubator-gluten/pull/8380#discussion_r1921731929
##########
cpp/velox/compute/WholeStageResultIterator.cc:
##########
@@ -51,6 +51,14 @@ const std::string kWriteIOTime = "writeIOTime";
// others
const std::string kHiveDefaultPartition = "__HIVE_DEFAULT_PARTITION__";
+std::string getQueryId(const std::unordered_map<std::string, std::string>& confMap) {
+ auto it = confMap.find(kQueryTraceQueryId);
+ if (it != confMap.end()) {
+ return it->second;
+ }
+ return "";
+}
+
Review Comment:
If `applicationId` is important for the feature and not yet passed through JNI, could also add it and use it for query context and task names / IDs in another PR. Thank you.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org
Re: [PR] [GLUTEN-8379][VL] Support query trace [incubator-gluten]
Posted by "jinchengchenghh (via GitHub)" <gi...@apache.org>.
jinchengchenghh commented on code in PR #8380:
URL: https://github.com/apache/incubator-gluten/pull/8380#discussion_r1921926821
##########
shims/common/src/main/scala/org/apache/gluten/config/GlutenConfig.scala:
##########
@@ -2288,4 +2294,48 @@ object GlutenConfig {
.doc("If enabled, gluten will not offload scan when encrypted parquet files are detected")
.booleanConf
.createWithDefault(false)
+
+ val QUERY_TRACE_ENABLED = buildConf("spark.gluten.sql.columnar.backend.velox.queryTraceEnabled")
+ .doc("Enable query tracing flag.")
+ .internal()
+ .booleanConf
+ .createWithDefault(false)
+
+ val QUERY_TRACE_DIR = buildConf("spark.gluten.sql.columnar.backend.velox.queryTraceDir")
+ .doc("Base dir of a query to store tracing data.")
Review Comment:
If the config is not set correctly, Velox will throw exception, so as other config.
```
***WARNING*** CPU scaling is enabled, the benchmark real time measurements may be noisy and will incur extra overhead.
W0120 15:09:59.768762 3040717 GenericBenchmark.cc:253] Setting CPU for thread 0 to 0
terminate called after throwing an instance of 'facebook::velox::VeloxUserError'
what(): Exception: VeloxUserError
Error Source: USER
Error Code: INVALID_ARGUMENT
Reason: Query trace enabled but the trace dir is not set
Retriable: False
Expression: !queryConfig.queryTraceDir().empty()
Function: maybeMakeTraceConfig
File: /mnt/DP_disk1/code/incubator-gluten/ep/build-velox/build/velox_ep/velox/exec/Task.cpp
Line: 3027
Stack trace:
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org
Re: [PR] [GLUTEN-8379][VL] Support query trace [incubator-gluten]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #8380:
URL: https://github.com/apache/incubator-gluten/pull/8380#issuecomment-2566088447
Run Gluten Clickhouse CI on x86
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org
Re: [PR] [GLUTEN-8379][VL] Support query trace [incubator-gluten]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #8380:
URL: https://github.com/apache/incubator-gluten/pull/8380#issuecomment-2566088365
https://github.com/apache/incubator-gluten/issues/8379
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org
Re: [PR] [GLUTEN-8379][VL] Support query trace [incubator-gluten]
Posted by "FelixYBW (via GitHub)" <gi...@apache.org>.
FelixYBW commented on PR #8380:
URL: https://github.com/apache/incubator-gluten/pull/8380#issuecomment-2569881287
@jinchengchenghh what's the difference/advantage from our microbenchmark tool?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org
Re: [PR] [GLUTEN-8379][VL] Support query trace [incubator-gluten]
Posted by "jackylee-ch (via GitHub)" <gi...@apache.org>.
jackylee-ch commented on code in PR #8380:
URL: https://github.com/apache/incubator-gluten/pull/8380#discussion_r1922083575
##########
shims/common/src/main/scala/org/apache/gluten/config/GlutenConfig.scala:
##########
@@ -2288,4 +2294,48 @@ object GlutenConfig {
.doc("If enabled, gluten will not offload scan when encrypted parquet files are detected")
.booleanConf
.createWithDefault(false)
+
+ val QUERY_TRACE_ENABLED = buildConf("spark.gluten.sql.columnar.backend.velox.queryTraceEnabled")
+ .doc("Enable query tracing flag.")
+ .internal()
+ .booleanConf
+ .createWithDefault(false)
+
+ val QUERY_TRACE_DIR = buildConf("spark.gluten.sql.columnar.backend.velox.queryTraceDir")
+ .doc("Base dir of a query to store tracing data.")
Review Comment:
Can we set it with default `/tmp/query_trace`?
BTW, if we want expose the config to user, we need remove the `internal()`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org
Re: [PR] [GLUTEN-8379][VL] Support query trace [incubator-gluten]
Posted by "jinchengchenghh (via GitHub)" <gi...@apache.org>.
jinchengchenghh merged PR #8380:
URL: https://github.com/apache/incubator-gluten/pull/8380
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org
Re: [PR] [GLUTEN-8379][VL] Support query trace [incubator-gluten]
Posted by "FelixYBW (via GitHub)" <gi...@apache.org>.
FelixYBW commented on PR #8380:
URL: https://github.com/apache/incubator-gluten/pull/8380#issuecomment-2572580885
> Can we consolidate the two functionalities? They sound overlap more or less?
If it can save the input of any plan node and reproduce the node only, it will be useful to debug.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org
Re: [PR] [GLUTEN-8379][VL] Support query trace [incubator-gluten]
Posted by "jinchengchenghh (via GitHub)" <gi...@apache.org>.
jinchengchenghh commented on code in PR #8380:
URL: https://github.com/apache/incubator-gluten/pull/8380#discussion_r1912599974
##########
cpp/velox/compute/WholeStageResultIterator.cc:
##########
@@ -558,6 +558,18 @@ std::unordered_map<std::string, std::string> WholeStageResultIterator::getQueryC
configs[velox::core::QueryConfig::kSparkLegacyDateFormatter] = "false";
}
+ const auto setIfExists = [&](const std::string& glutenKey, const std::string& veloxKey) {
Review Comment:
Yes, good suggestion, I think the config needs to do the refactor, now if the config not set by java side, we will set a default value of velox config to velox query config, we should change to not set the config.
If velox config default value is changed, we can change automatic with them if we don't have different default value with velox.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org
Re: [PR] [GLUTEN-8379][VL] Support query trace [incubator-gluten]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #8380:
URL: https://github.com/apache/incubator-gluten/pull/8380#issuecomment-2568595573
Run Gluten Clickhouse CI on x86
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org
Re: [PR] [GLUTEN-8379][VL] Support query trace [incubator-gluten]
Posted by "jinchengchenghh (via GitHub)" <gi...@apache.org>.
jinchengchenghh commented on PR #8380:
URL: https://github.com/apache/incubator-gluten/pull/8380#issuecomment-2568701611
No, I just add the config. The exception is because we don't support to serialize ValueStream Node to json, we could support it, it is not hard.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org
Re: [PR] [GLUTEN-8379][VL] Support query trace [incubator-gluten]
Posted by "jinchengchenghh (via GitHub)" <gi...@apache.org>.
jinchengchenghh commented on PR #8380:
URL: https://github.com/apache/incubator-gluten/pull/8380#issuecomment-2568706304
QueryTrace only supports some operators, we need to extend it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org
Re: [PR] [GLUTEN-8379][VL] Support query trace [incubator-gluten]
Posted by "jinchengchenghh (via GitHub)" <gi...@apache.org>.
jinchengchenghh commented on PR #8380:
URL: https://github.com/apache/incubator-gluten/pull/8380#issuecomment-2571844190
Our benchmark accepts a total velox plan, but query trace can specify the plan node id, it can save the input of any plan node @FelixYBW
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org
Re: [PR] [GLUTEN-8379][VL] Support query trace [incubator-gluten]
Posted by "jinchengchenghh (via GitHub)" <gi...@apache.org>.
jinchengchenghh commented on PR #8380:
URL: https://github.com/apache/incubator-gluten/pull/8380#issuecomment-2597282454
The GenericBenchmark is frequently used by us CC @JkSelf , it is really usefully for debug in cpp side, we can use vscode to do step-by-step debug. And query trace is widely used in Velox to do correctness verification and performance profiling, so I think we need to enable it in Gluten. and with this optimization https://github.com/apache/incubator-gluten/pull/8380#issuecomment-2594652831, we could drop the ValueStreamNode to ValusNode replace. @zhztheplayer
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org
Re: [PR] [GLUTEN-8379][VL] Support query trace [incubator-gluten]
Posted by "jinchengchenghh (via GitHub)" <gi...@apache.org>.
jinchengchenghh commented on code in PR #8380:
URL: https://github.com/apache/incubator-gluten/pull/8380#discussion_r1921931127
##########
cpp/velox/compute/WholeStageResultIterator.cc:
##########
@@ -51,6 +51,14 @@ const std::string kWriteIOTime = "writeIOTime";
// others
const std::string kHiveDefaultPartition = "__HIVE_DEFAULT_PARTITION__";
+std::string getQueryId(const std::unordered_map<std::string, std::string>& confMap) {
+ auto it = confMap.find(kQueryTraceQueryId);
+ if (it != confMap.end()) {
+ return it->second;
+ }
+ return "";
+}
+
Review Comment:
The queryId concept is not really query id, it is velox query id, not Spark queryId, now one query for one task, so I think we can use the same name with task name.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org
Re: [PR] [GLUTEN-8379][VL] Support query trace [incubator-gluten]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #8380:
URL: https://github.com/apache/incubator-gluten/pull/8380#issuecomment-2603921305
Run Gluten ClickHouse CI on ARM
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@gluten.apache.org
For additional commands, e-mail: commits-help@gluten.apache.org