Skip to content

Commit f9e45ff

Browse files
committed
Disable graph optimization (to fix flaky tests in onnx)
1 parent 56651ec commit f9e45ff

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

.circleci/config.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,9 +162,9 @@ jobs:
162162
- run:
163163
name: Submodule checkout
164164
command: git submodule update --init --recursive
165-
#- restore_cache:
166-
# keys:
167-
# - build-dependencies-{{ checksum "get_deps.sh" }}
165+
- restore_cache:
166+
keys:
167+
- build-dependencies-{{ checksum "get_deps.sh" }}
168168
# If no exact match is found will get dependencies from source
169169
- setup-automation
170170
- run:

opt/build/onnxruntime/Dockerfile.x64

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ RUN apt-get install -y locales && \
2424

2525
WORKDIR /build
2626

27-
ARG BUILDTYPE=RelWithDebInfo
27+
ARG BUILDTYPE=MinSizeRel
2828

2929
ARG BUILDARGS="--config ${BUILDTYPE} --parallel"
3030

opt/build/onnxruntime/pack.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ VER="$1"
55
PLATFORM="$2"
66

77
mkdir -p pack/include pack/lib
8-
cp onnxruntime/build/Linux/Debug/libonnxruntime.so.${VER} pack/lib/
8+
cp onnxruntime/build/Linux/MinSizeRel/libonnxruntime.so.${VER} pack/lib/
99
cp onnxruntime/docs/C_API.md pack/
1010
cp onnxruntime/LICENSE pack/
1111
cp onnxruntime/README.md pack/

src/backends/onnxruntime.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ RAI_Model *RAI_ModelCreateORT(RAI_Backend backend, const char *devicestr, RAI_Mo
329329
}
330330

331331
// TODO: these options could be configured at the AI.CONFIG level
332-
// ONNX_VALIDATE_STATUS(ort->SetSessionGraphOptimizationLevel(session_options, 1))
332+
ONNX_VALIDATE_STATUS(ort->SetSessionGraphOptimizationLevel(session_options, ORT_DISABLE_ALL))
333333
ONNX_VALIDATE_STATUS(
334334
ort->SetIntraOpNumThreads(session_options, (int)opts.backends_intra_op_parallelism))
335335
ONNX_VALIDATE_STATUS(

tests/flow/tests_onnx.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,7 @@ def test_onnx_use_custom_allocator(env):
504504
ai_memory_config = {k.split(":")[0]: k.split(":")[1]
505505
for k in con.execute_command("INFO MODULES").decode().split("#")[4].split()[1:]}
506506
allocator_access_num_after = ai_memory_config["ai_onnxruntime_memory_access_num"]
507-
env.assertEqual(int(allocator_access_num_after) - int(allocator_access_num_before), 16)
507+
env.assertEqual(int(allocator_access_num_after) - int(allocator_access_num_before), 22)
508508

509509
values = con.execute_command('AI.TENSORGET', 'b{1}', 'VALUES')
510510
argmax = max(range(len(values)), key=lambda i: values[i])

0 commit comments

Comments
 (0)