[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug#69591] [PATCH 21/31] gnu: Add foxi.
From: |
David Elsing |
Subject: |
[bug#69591] [PATCH 21/31] gnu: Add foxi. |
Date: |
Wed, 6 Mar 2024 19:40:27 +0000 |
* gnu/packages/machine-learning.scm (foxi): New variable.
* gnu/packages/patches/foxi-fix-build.patch: New file.
* gnu/local.mk (dist_patch_DATA): Register it.
---
gnu/local.mk | 1 +
gnu/packages/machine-learning.scm | 29 ++++++++++++
gnu/packages/patches/foxi-fix-build.patch | 55 +++++++++++++++++++++++
3 files changed, 85 insertions(+)
create mode 100644 gnu/packages/patches/foxi-fix-build.patch
diff --git a/gnu/local.mk b/gnu/local.mk
index f81ea13031..c88c21ac60 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1204,6 +1204,7 @@ dist_patch_DATA =
\
%D%/packages/patches/foobillard++-pkg-config.patch \
%D%/packages/patches/foomatic-filters-CVE-2015-8327.patch \
%D%/packages/patches/foomatic-filters-CVE-2015-8560.patch \
+ %D%/packages/patches/foxi-fix-build.patch \
%D%/packages/patches/fp16-implicit-double.patch \
%D%/packages/patches/fp16-system-libraries.patch \
%D%/packages/patches/fpc-reproducibility.patch \
diff --git a/gnu/packages/machine-learning.scm
b/gnu/packages/machine-learning.scm
index c883af54d9..5c21e4ed46 100644
--- a/gnu/packages/machine-learning.scm
+++ b/gnu/packages/machine-learning.scm
@@ -4215,6 +4215,35 @@ (define-public tensorpipe
the tensors contained therein.")
(license license:bsd-3))))
+(define-public foxi
+ (let
+ ((commit "c278588e34e535f0bb8f00df3880d26928038cad")
+ (revision "0"))
+ (package
+ (name "foxi")
+ (version (git-version "1.4.1" revision commit))
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/houseroad/foxi")
+ (commit commit)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "0q3ssm5hmmvwfwx87mnnajbavzgpahybw6rpn8ysr9r095dwgq5a"))
+ (patches (search-patches "foxi-fix-build.patch"))))
+ (build-system cmake-build-system)
+ (arguments
+ (list
+ ;; No tests
+ #:tests? #f))
+ (home-page "https://github.com/houseroad/foxi")
+ (synopsis "ONNXIFI with Facebook Extension")
+ (description "ONNX Interface for Framework Integration is a
cross-platform
+API for loading and executing ONNX graphs on optimized backends. This package
+contains facebook extensions and is used by PyTorch.")
+ (license license:expat))))
+
;; Please also update python-torchvision when updating this package.
(define-public python-pytorch
(package
diff --git a/gnu/packages/patches/foxi-fix-build.patch
b/gnu/packages/patches/foxi-fix-build.patch
new file mode 100644
index 0000000000..d82090ad38
--- /dev/null
+++ b/gnu/packages/patches/foxi-fix-build.patch
@@ -0,0 +1,55 @@
+Taken from https://github.com/houseroad/foxi/pull/25.
+
+diff --git a/foxi/onnxifi_dummy.c b/foxi/onnxifi_dummy.c
+index 2115af9..73e25fc 100644
+--- a/foxi/onnxifi_dummy.c
++++ b/foxi/onnxifi_dummy.c
+@@ -103,7 +103,10 @@ ONNXIFI_PUBLIC ONNXIFI_CHECK_RESULT onnxStatus
ONNXIFI_ABI onnxInitGraph(
+ const void* onnxModel,
+ uint32_t weightCount,
+ const onnxTensorDescriptorV1* weightDescriptors,
+- onnxGraph* graph) {
++ onnxGraph* graph,
++ uint32_t maxSeqLength,
++ void* deferredWeightReader) {
++
+ if (graph == NULL) {
+ return ONNXIFI_STATUS_INVALID_POINTER;
+ }
+@@ -215,6 +218,8 @@ ONNXIFI_PUBLIC ONNXIFI_CHECK_RESULT onnxStatus ONNXIFI_ABI
+ onnxWaitEventFor(onnxEvent event,
+ uint32_t timeoutMs,
+ onnxEventState* eventState,
+- onnxStatus* eventStatus) {
++ onnxStatus* eventStatus,
++ char* message,
++ size_t* messageLength) {
+ return ONNXIFI_STATUS_SUCCESS;
+ }
+\ No newline at end of file
+diff --git a/foxi/onnxifi_wrapper.c b/foxi/onnxifi_wrapper.c
+index 98a9325..abe1440 100644
+--- a/foxi/onnxifi_wrapper.c
++++ b/foxi/onnxifi_wrapper.c
+@@ -761,7 +761,9 @@ ONNXIFI_PUBLIC onnxStatus ONNXIFI_ABI onnxInitGraph(
+ const void* onnxModel,
+ uint32_t weightsCount,
+ const onnxTensorDescriptorV1* weightDescriptors,
+- onnxGraph* graph)
++ onnxGraph* graph,
++ uint32_t maxSeqLength,
++ void* deferredWeightReader)
+ {
+ if (graph == NULL) {
+ return ONNXIFI_STATUS_INVALID_POINTER;
+@@ -797,7 +799,9 @@ ONNXIFI_PUBLIC onnxStatus ONNXIFI_ABI onnxInitGraph(
+ onnxModel,
+ weightsCount,
+ weightDescriptors,
+- &graph_wrapper->graph);
++ &graph_wrapper->graph,
++ maxSeqLength,
++ deferredWeightReader);
+ switch (status) {
+ case ONNXIFI_STATUS_SUCCESS:
+ case ONNXIFI_STATUS_FALLBACK:
--
2.41.0
- [bug#69591] [PATCH 20/31] gnu: Add qnnpack., (continued)
- [bug#69591] [PATCH 20/31] gnu: Add qnnpack., David Elsing, 2024/03/06
- [bug#69591] [PATCH 17/31] gnu: oneapi-dnnl: Update to 3.3.5., David Elsing, 2024/03/06
- [bug#69591] [PATCH 25/31] gnu: Add qnnpack-pytorch., David Elsing, 2024/03/06
- [bug#69591] [PATCH 19/31] gnu: Add fbgemm., David Elsing, 2024/03/06
- [bug#69591] [PATCH 30/31] gnu: Add qnnpack-pytorch-for-r-torch., David Elsing, 2024/03/06
- [bug#69591] [PATCH 26/31] gnu: python-pytorch: Update to 2.2.1 and unbundle dependencies., David Elsing, 2024/03/06
- [bug#69591] [PATCH 27/31] gnu: python-torchvision: Update to 0.17.1., David Elsing, 2024/03/06
- [bug#69591] [PATCH 18/31] gnu: Add tensorpipe., David Elsing, 2024/03/06
- [bug#69591] [PATCH 24/31] gnu: Remove xnnpack-for-torch2., David Elsing, 2024/03/06
- [bug#69591] [PATCH 29/31] gnu: Add oneapi-dnnl-for-r-torch., David Elsing, 2024/03/06
- [bug#69591] [PATCH 21/31] gnu: Add foxi.,
David Elsing <=
- [bug#69591] [PATCH 31/31] gnu: python-pytorch-for-r-torch: Adjust to new python-pytorch., David Elsing, 2024/03/06
- [bug#69591] [PATCH 28/31] gnu: Add ideep-pytorch-for-r-torch., David Elsing, 2024/03/06
- [bug#69591] [PATCH v2 00/31] Unbundle and update python-pytorch, David Elsing, 2024/03/12
- [bug#69591] [PATCH v2 01/31] gnu: asmjit: Update to commit 3ca5c18., David Elsing, 2024/03/12
- [bug#69591] [PATCH v2 03/31] gnu: Add python-optree., David Elsing, 2024/03/12
- [bug#69591] [PATCH v2 07/31] gnu: Add python-pytest-rerunfailures-13., David Elsing, 2024/03/12
- [bug#69591] [PATCH v2 05/31] gnu: Add python-pytest-shard., David Elsing, 2024/03/12
- [bug#69591] [PATCH v2 04/31] gnu: Add python-pytest-flakefinder., David Elsing, 2024/03/12
- [bug#69591] [PATCH v2 06/31] gnu: Add python-expecttest., David Elsing, 2024/03/12
- [bug#69591] [PATCH v2 11/31] gnu: Remove flatbuffers-next-shared., David Elsing, 2024/03/12