Skip to content

Commit 23011e5

Browse files
committedMar 25, 2025
triton-llvm: fix nondeterministic hang
1 parent 8c277da commit 23011e5

File tree

2 files changed

+31
-0
lines changed

2 files changed

+31
-0
lines changed
 
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
From 705ba309ccebb0f505107a83542ff13d555008e0 Mon Sep 17 00:00:00 2001
2+
From: Stephen Huan <stephen.huan@cgdct.moe>
3+
Date: Mon, 24 Mar 2025 21:35:42 -0400
4+
Subject: [PATCH] [llvm-exegesis] Timeout if subprocess executor hangs
5+
6+
The call to llvm_exegesis_exe nondeterministically hangs, causing
7+
llvm's tests to block. Introduce a timeout when this happens.
8+
---
9+
llvm/test/tools/llvm-exegesis/lit.local.cfg | 3 ++-
10+
1 file changed, 2 insertions(+), 1 deletion(-)
11+
12+
diff --git a/llvm/test/tools/llvm-exegesis/lit.local.cfg b/llvm/test/tools/llvm-exegesis/lit.local.cfg
13+
index a51a2d73442fa..8b7c13f5eb1b6 100644
14+
--- a/llvm/test/tools/llvm-exegesis/lit.local.cfg
15+
+++ b/llvm/test/tools/llvm-exegesis/lit.local.cfg
16+
@@ -24,9 +24,10 @@ def can_use_perf_counters(mode, extra_options=[]):
17+
+ extra_options,
18+
stdout=subprocess.DEVNULL,
19+
stderr=subprocess.DEVNULL,
20+
+ timeout=1,
21+
)
22+
return return_code == 0
23+
- except OSError:
24+
+ except (OSError, subprocess.TimeoutExpired):
25+
print("could not exec llvm-exegesis")
26+
return False
27+

‎pkgs/by-name/tr/triton-llvm/package.nix

+4
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,10 @@ stdenv.mkDerivation (finalAttrs: {
9494
url = "https://github.com/llvm/llvm-project//commit/84837e3cc1cf17ed71580e3ea38299ed2bfaa5f6.patch";
9595
hash = "sha256-QKa+kyXjjGXwTQTEpmKZx5yYjOyBX8A8NQoIYUaGcIw=";
9696
})
97+
# fix tests nondeterministically hanging
98+
# [llvm-exegesis] Timeout if subprocess executor hangs #132861
99+
# https://github.com/llvm/llvm-project/pull/132861
100+
./llvm-exegesis-timeout.patch
97101
];
98102

99103
nativeBuildInputs =

0 commit comments

Comments
 (0)
Failed to load comments.