taiyang-li opened a new pull request, #11491:
URL: https://github.com/apache/incubator-gluten/pull/11491

   ## Summary
   
   Extend the stage-level resource profile adjustment rule and its coverage so 
that stages containing PartialProject/PartialGenerate operators can also 
benefit from heap/off-heap tuning.
   
   ## Changes
   
   - **GlutenAutoAdjustStageResourceProfile**
     - Compute `fallenNodeRatio` once and introduce a new `hasPartialNode` flag 
based on the stage plan nodes.
     - Treat stages that contain PartialProject/PartialGenerate operators as 
candidates for the "partial fallback" resource adjustment path, even when the 
fallen-node ratio is below the configured threshold and the stage is not a 
whole-stage fallback.
     - Keep using existing experimental knobs `autoAdjustStageRPHeapRatio` and 
`autoAdjustStageRPOffHeapRatio` to tune heap and off-heap memory, and maintain 
the existing behavior for whole-stage fallback.
     - Add a helper `hasPartialOperator(planNodes: Seq[SparkPlan])` in the 
companion object, implemented via `SparkPlan.nodeName` string matching to avoid 
compile-time coupling with backend-specific exec classes.
     - Add log output when the partial-fallback/partial-operator path is taken 
to aid observability.
   
   - **Tests (Velox backend)**
     - Extend `AutoAdjustStageResourceProfileSuite` with helpers to count 
`ColumnarPartialProjectExec` / `ColumnarPartialGenerateExec` and manage 
temporary Hive functions.
     - Add a test that enables `ENABLE_COLUMNAR_PARTIAL_PROJECT` and runs a 
grouped aggregation with a Scala UDF on `tmp1`, asserting that the executed 
plan contains `ColumnarPartialProjectExec` and exactly one 
`ApplyResourceProfileExec`.
     - Add a test that enables `ENABLE_COLUMNAR_PARTIAL_GENERATE`, registers a 
`SimpleUDTF`-based Hive UDTF, and runs a query with `lateral view` and a 
subsequent aggregation on `tmp1`, asserting that the executed plan contains 
`ColumnarPartialGenerateExec` and exactly one `ApplyResourceProfileExec`.
   
   - **Documentation**
     - Update `docs/get-started/VeloxStageResourceAdj.md`:
       - Add `spark.gluten.auto.adjustStageResources.offheap.ratio` to the 
configuration table with description and default value, and fix the example key 
for enabling auto adjustment to `spark.gluten.auto.adjustStageResource.enabled`.
       - Introduce a new **Scenario 2: PartialProject / PartialGenerate 
Exists** subsection describing when and how stages with 
PartialProject/PartialGenerate trigger moderate heap/off-heap adjustments using 
the existing ratios.
       - Extend the verification section with guidance on checking executor JVM 
options (e.g. via `ps aux | grep java`) to validate that stage-specific 
heap/off-heap settings take effect.
   
   ## Testing
   
   - `mvn -q -DskipTests install` (from project root) to build `gluten-core`, 
`gluten-substrait`, `gluten-ras`, `shims`, and related modules: **PASS** after 
fixing spotless violations in `GlutenAutoAdjustStageResourceProfile.scala`.
   - `cd backends-velox && mvn -q -Dtest=AutoAdjustStageResourceProfileSuite 
test`: **FAILED** due to unresolved dependency 
`org.apache.gluten:gluten-arrow:jar:1.6.0-SNAPSHOT` (Arrow 15.0.0-gluten 
artifacts are not available in the configured Maven mirror in this 
environment). The new tests compile, but the suite could not be executed 
end-to-end without the Arrow artifacts.
   
   
   Change-Id: I91541b89c128c6f8e8751440ed1fd5606a3d7049
   
   <!--
   Thank you for submitting a pull request! Here are some tips:
   
   1. For first-time contributors, please read our contributing guide:
      https://github.com/apache/incubator-gluten/blob/main/CONTRIBUTING.md
   2. If necessary, create a GitHub issue for discussion beforehand to avoid 
duplicate work.
   3. If the PR is specific to a single backend, include [VL] or [CH] in the PR 
title to indicate the
      Velox or ClickHouse backend, respectively.
   4. If the PR is not ready for review, please mark it as a draft.
   -->
   
   ## What changes are proposed in this pull request?
   
   <!--
   Provide a clear and concise description of the changes introduced in this PR.
   Ensure the PR description aligns with the code changes, especially after 
updates.
   If applicable, include "Fixes #<GitHub_Issue_ID>" to automatically close the 
corresponding issue
   when the PR is merged.
   -->
   
   ## How was this patch tested?
   
   <!--
   Describe how the changes were tested, if applicable.
   Include new tests to validate the functionality, if necessary.
   For UI-related changes, attach screenshots to demonstrate the updates.
   -->
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to