Skip to content

Conversation

@anmyachev
Copy link
Contributor

@anmyachev anmyachev commented Jun 10, 2025

@anmyachev
Copy link
Contributor Author

@whitneywhtsang could you remind me how to disable this mode using env var?

@whitneywhtsang
Copy link
Contributor

@whitneywhtsang could you remind me how to disable this mode using env var?

By default fast math is not enabled, but allow contract is, it can be disabled by TRITON_INTEL_FAST_MATH=0 or TRITON_DEFAULT_FP_FUSION=0.

@whitneywhtsang
Copy link
Contributor

Instead of reverting the SPV extension, can we do the change below?

diff --git a/third_party/intel/triton_xpu.cc b/third_party/intel/triton_xpu.cc
index 908d57c2e6..286eadd7f5 100644
--- a/third_party/intel/triton_xpu.cc
+++ b/third_party/intel/triton_xpu.cc
@@ -296,7 +296,7 @@ void init_triton_intel(py::module &&m) {
         if (auto *op = dyn_cast<FPMathOperator>(&inst)) {
           FastMathFlags FMF;
           // Default to allow contract when default fp fusion is not disabled.
-          if ((!enableFpFusion.has_value() || enableFpFusion.value()) &&
+          if ((enableFpFusion.has_value() && enableFpFusion.value()) &&
               !fastMath.has_value()) {

@anmyachev
Copy link
Contributor Author

@anmyachev
Copy link
Contributor Author

anmyachev commented Jun 11, 2025

Instead of reverting the SPV extension, can we do the change below?

diff --git a/third_party/intel/triton_xpu.cc b/third_party/intel/triton_xpu.cc
index 908d57c2e6..286eadd7f5 100644
--- a/third_party/intel/triton_xpu.cc
+++ b/third_party/intel/triton_xpu.cc
@@ -296,7 +296,7 @@ void init_triton_intel(py::module &&m) {
         if (auto *op = dyn_cast<FPMathOperator>(&inst)) {
           FastMathFlags FMF;
           // Default to allow contract when default fp fusion is not disabled.
-          if ((!enableFpFusion.has_value() || enableFpFusion.value()) &&
+          if ((enableFpFusion.has_value() && enableFpFusion.value()) &&
               !fastMath.has_value()) {

I'll try locally first.

UPD it works as well. However we may not have to make this change, since without using freezing option one of the models passes #4479 (comment). Let's look at the rest

@anmyachev anmyachev force-pushed the amyachev/test-e2e branch from 9662132 to 87e68ae Compare June 12, 2025 17:59
@anmyachev anmyachev changed the base branch from main to release/3.4.x June 12, 2025 18:00
@anmyachev anmyachev force-pushed the amyachev/test-e2e branch 2 times, most recently from 6a9a54b to d299f9c Compare June 12, 2025 18:11
@anmyachev anmyachev changed the base branch from release/3.4.x to main June 13, 2025 08:52
@anmyachev anmyachev force-pushed the amyachev/test-e2e branch from d299f9c to 2d8e1d2 Compare June 13, 2025 08:54
@anmyachev
Copy link
Contributor Author

Instead of reverting the SPV extension, can we do the change below?

diff --git a/third_party/intel/triton_xpu.cc b/third_party/intel/triton_xpu.cc
index 908d57c2e6..286eadd7f5 100644
--- a/third_party/intel/triton_xpu.cc
+++ b/third_party/intel/triton_xpu.cc
@@ -296,7 +296,7 @@ void init_triton_intel(py::module &&m) {
         if (auto *op = dyn_cast<FPMathOperator>(&inst)) {
           FastMathFlags FMF;
           // Default to allow contract when default fp fusion is not disabled.
-          if ((!enableFpFusion.has_value() || enableFpFusion.value()) &&
+          if ((enableFpFusion.has_value() && enableFpFusion.value()) &&
               !fastMath.has_value()) {

@whitneywhtsang according to results from Inductor tests: https://github.com/intel/intel-xpu-backend-for-triton/actions/runs/15630616934/job/44033895910 it's not an option.

@alexbaden
Copy link
Contributor

What is the impact of this change on our micro benchmarks?

@whitneywhtsang
Copy link
Contributor

@whitneywhtsang according to results from Inductor tests: https://github.com/intel/intel-xpu-backend-for-triton/actions/runs/15630616934/job/44033895910 it's not an option.

The reversal of 353d6ff and the suggested change should behave the same unless TRITON_DEFAULT_FP_FUSION is set explicitly.
Do those test cases only fail with the suggested change?

@anmyachev
Copy link
Contributor Author

What is the impact of this change on our micro benchmarks?

I don't know

Do those test cases only fail with the suggested change?

It looks like we have a regression regardless of these changes, between https://github.com/intel/intel-xpu-backend-for-triton/actions/runs/15632063117 and https://github.com/intel/intel-xpu-backend-for-triton/actions/runs/15607709679

@anmyachev
Copy link
Contributor Author

What is the impact of this change on our micro benchmarks?

Should we run benchmarks to get information?

@anmyachev anmyachev force-pushed the amyachev/test-e2e branch from 2d8e1d2 to 0bf0876 Compare June 13, 2025 15:47
@anmyachev anmyachev force-pushed the amyachev/test-e2e branch from 0bf0876 to de86a60 Compare June 13, 2025 18:05
@anmyachev
Copy link
Contributor Author

Benchmarks run: https://github.com/intel/intel-xpu-backend-for-triton/actions/runs/15641089963. I'm probably done for today. If you can see that there are no regressions, we can merge it today. Since there is no more regression in Inductor tests.

@anmyachev anmyachev marked this pull request as ready for review June 13, 2025 18:10
@whitneywhtsang
Copy link
Contributor

Started another one https://github.com/intel/intel-xpu-backend-for-triton/actions/runs/15641240442 with special tag pr-4473, so it will be easier to use Grafana to check for performance impact later.

Copy link
Contributor

@whitneywhtsang whitneywhtsang left a comment

Choose a reason for hiding this comment

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

Please create an issue to track reverting this change.
The change LGTM assuming no performance degradation.

@whitneywhtsang whitneywhtsang merged commit 38a1984 into main Jun 15, 2025
33 of 34 checks passed
@whitneywhtsang whitneywhtsang deleted the amyachev/test-e2e branch June 15, 2025 20:37
@anmyachev
Copy link
Contributor Author

Please create an issue to track reverting this change. The change LGTM assuming no performance degradation.

#4514

david-hls pushed a commit to david-hls/intel-xpu-backend-for-triton that referenced this pull request Jun 18, 2025
Previously we only filter leave nodes. This PR improves the filter
function by supporting filter both internal and leave nodes.

`-i` finds frames that match the given regular expression and return
*all nodes* in the paths that pass through the matching frames.

`-e` excludes frames that match the given regular expression and their
children.
chuanqi129 pushed a commit that referenced this pull request Jun 20, 2025
@anmyachev anmyachev restored the amyachev/test-e2e branch June 20, 2025 12:42
whitneywhtsang added a commit that referenced this pull request Jun 25, 2025
anmyachev added a commit that referenced this pull request Jun 26, 2025
anmyachev added a commit that referenced this pull request Jul 22, 2025
…4473)" (#4576)

This reverts commit 38a1984.

Known cases of impact on accuracy of the following models: detectron2
and doctr_reco_predictor from
#4412 on PVC
and LayoutLMForSequenceClassification from
#4509 on ARL

---------

Signed-off-by: Anatoly Myachev <[email protected]>
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