Skip to content

Commit 9f40322

Browse files
authored
Add patch to Tensorflow backend for GCC 14 compatibility (#738)
In libtensorflow, the `input` argument to `TF_SessionRun` seems to be mistyped to `TF_Output` instead of `TF_Input`. These two types differ only in name. GCC-14 catches this and throws an error, even though earlier versions allow this. To solve this problem, patches are applied to the Tensorflow backend in RedisAI. Future versions of Tensorflow may fix this problem, but for now this seems to be the best workaround. [ committed by @ashao ] [ reviewed by @MattToast ]
1 parent 5c2de47 commit 9f40322

File tree

7 files changed

+82
-2
lines changed

7 files changed

+82
-2
lines changed

doc/changelog.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,29 @@ Jump to:
99

1010
## SmartSim
1111

12-
### Develop
13-
1412
To be released at some point in the future
1513

1614
Description
1715

16+
- Implement workaround for Tensorflow that allows RedisAI to build with GCC-14
1817
- Add instructions for installing SmartSim on PML's Scylla
1918

2019
Detailed Notes
20+
21+
- In libtensorflow, the input argument to TF_SessionRun seems to be mistyped to
22+
TF_Output instead of TF_Input. These two types differ only in name. GCC-14
23+
catches this and throws an error, even though earlier versions allow this. To
24+
solve this problem, patches are applied to the Tensorflow backend in RedisAI.
25+
Future versions of Tensorflow may fix this problem, but for now this seems to be
26+
the best workaround.
27+
([SmartSim-PR738](https://github.com/CrayLabs/SmartSim/pull/738))
2128
- PML's Scylla is still under development. The usual SmartSim
2229
build instructions do not apply because the GPU dependencies
2330
have yet to be installed at a system-wide level. Scylla has
2431
its own entry in the documentation.
2532
([SmartSim-PR733](https://github.com/CrayLabs/SmartSim/pull/733))
2633

34+
2735
### 0.8.0
2836

2937
Released on 27 September, 2024

smartsim/_core/_install/configs/mlpackages/DarwinARM64CPU.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,18 @@
2828
"source_file": "src/backends/libtorch_c/CMakeLists.txt",
2929
"regex": "set_property\\(TARGET\\storch_c\\sPROPERTY\\sCXX_STANDARD\\s(98|11|14)\\)",
3030
"replacement": "set_property(TARGET torch_c PROPERTY CXX_STANDARD 17)"
31+
},
32+
{
33+
"description": "Fix the type in a Tensorflow function signature",
34+
"source_file": "src/backends/tensorflow.c",
35+
"regex": "TF_Input inputs",
36+
"replacement": "TF_Output inputs"
37+
},
38+
{
39+
"description": "Fix the type in a Tensorflow function signature",
40+
"source_file": "src/backends/tensorflow.c",
41+
"regex": "TF_Input port",
42+
"replacement": "TF_Output port"
3143
}
3244
]
3345
},

smartsim/_core/_install/configs/mlpackages/DarwinX64CPU.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,18 @@
2828
"source_file": "src/backends/libtorch_c/CMakeLists.txt",
2929
"regex": "set_property\\(TARGET\\storch_c\\sPROPERTY\\sCXX_STANDARD\\s(98|11|14)\\)",
3030
"replacement": "set_property(TARGET torch_c PROPERTY CXX_STANDARD 17)"
31+
},
32+
{
33+
"description": "Fix the type in a Tensorflow function signature",
34+
"source_file": "src/backends/tensorflow.c",
35+
"regex": "TF_Input inputs",
36+
"replacement": "TF_Output inputs"
37+
},
38+
{
39+
"description": "Fix the type in a Tensorflow function signature",
40+
"source_file": "src/backends/tensorflow.c",
41+
"regex": "TF_Input port",
42+
"replacement": "TF_Output port"
3143
}
3244
]
3345
},

smartsim/_core/_install/configs/mlpackages/LinuxX64CPU.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,18 @@
2828
"source_file": "src/backends/libtorch_c/CMakeLists.txt",
2929
"regex": "set_property\\(TARGET\\storch_c\\sPROPERTY\\sCXX_STANDARD\\s(98|11|14)\\)",
3030
"replacement": "set_property(TARGET torch_c PROPERTY CXX_STANDARD 17)"
31+
},
32+
{
33+
"description": "Fix the type in a Tensorflow function signature",
34+
"source_file": "src/backends/tensorflow.c",
35+
"regex": "TF_Input inputs",
36+
"replacement": "TF_Output inputs"
37+
},
38+
{
39+
"description": "Fix the type in a Tensorflow function signature",
40+
"source_file": "src/backends/tensorflow.c",
41+
"regex": "TF_Input port",
42+
"replacement": "TF_Output port"
3143
}
3244
]
3345
},

smartsim/_core/_install/configs/mlpackages/LinuxX64CUDA11.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,18 @@
2828
"source_file": "src/backends/libtorch_c/CMakeLists.txt",
2929
"regex": "set_property\\(TARGET\\storch_c\\sPROPERTY\\sCXX_STANDARD\\s(98|11|14)\\)",
3030
"replacement": "set_property(TARGET torch_c PROPERTY CXX_STANDARD 17)"
31+
},
32+
{
33+
"description": "Fix the type in a Tensorflow function signature",
34+
"source_file": "src/backends/tensorflow.c",
35+
"regex": "TF_Input inputs",
36+
"replacement": "TF_Output inputs"
37+
},
38+
{
39+
"description": "Fix the type in a Tensorflow function signature",
40+
"source_file": "src/backends/tensorflow.c",
41+
"regex": "TF_Input port",
42+
"replacement": "TF_Output port"
3143
}
3244
]
3345
},

smartsim/_core/_install/configs/mlpackages/LinuxX64CUDA12.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,18 @@
2828
"source_file": "src/backends/libtorch_c/CMakeLists.txt",
2929
"regex": "set_property\\(TARGET\\storch_c\\sPROPERTY\\sCXX_STANDARD\\s(98|11|14)\\)",
3030
"replacement": "set_property(TARGET torch_c PROPERTY CXX_STANDARD 17)"
31+
},
32+
{
33+
"description": "Fix the type in a Tensorflow function signature",
34+
"source_file": "src/backends/tensorflow.c",
35+
"regex": "TF_Input inputs",
36+
"replacement": "TF_Output inputs"
37+
},
38+
{
39+
"description": "Fix the type in a Tensorflow function signature",
40+
"source_file": "src/backends/tensorflow.c",
41+
"regex": "TF_Input port",
42+
"replacement": "TF_Output port"
3143
}
3244
]
3345
},

smartsim/_core/_install/configs/mlpackages/LinuxX64ROCM6.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,18 @@
4040
"source_file": "../package/libtorch/share/cmake/Caffe2/Caffe2Targets.cmake",
4141
"regex": "/opt/rocm",
4242
"replacement": "$ENV{ROCM_PATH}"
43+
},
44+
{
45+
"description": "Fix the type in a Tensorflow function signature",
46+
"source_file": "src/backends/tensorflow.c",
47+
"regex": "TF_Input inputs",
48+
"replacement": "TF_Output inputs"
49+
},
50+
{
51+
"description": "Fix the type in a Tensorflow function signature",
52+
"source_file": "src/backends/tensorflow.c",
53+
"regex": "TF_Input port",
54+
"replacement": "TF_Output port"
4355
}
4456
]
4557
}

0 commit comments

Comments
 (0)