Skip to content
Permalink
Browse files

Switch to foxi (#2449)

* switch to foxi

* only include the header instead of link

* update the doc
  • Loading branch information...
houseroad authored and yinghai committed Feb 27, 2019
1 parent 8e455a6 commit 37ebe41f6e06c34efb4317e5772e442ef1f11a0a
@@ -10,3 +10,6 @@
[submodule "tests/OutputCheck"]
path = tests/OutputCheck
url = https://github.com/stp/OutputCheck.git
[submodule "thirdparty/foxi"]
path = thirdparty/foxi
url = https://github.com/houseroad/foxi.git
@@ -100,6 +100,10 @@ if(NOT EXISTS "${GLOW_THIRDPARTY_DIR}/onnx")
message(FATAL_ERROR "No onnx git submodule. Run: git submodule update --init --recursive")
endif()

if(NOT EXISTS "${GLOW_THIRDPARTY_DIR}/foxi")
message(FATAL_ERROR "No foxi git submodule. Run: git submodule update --init --recursive")
endif()

if(NOT EXISTS "${GLOW_THIRDPARTY_DIR}/fp16")
message(FATAL_ERROR "No fp16 git submodule. Run: git submodule update --init --recursive")
else()
@@ -2,6 +2,8 @@

[ONNXIFI](https://github.com/onnx/onnx/blob/master/docs/ONNXIFI.md) is an
interface that allows PyTorch/Caffe2 to use Glow as an execution backend.
Right now, [FOXI](https://github.com/houseroad/foxi) (i.e., ONNXIFI with
Facebook Extension) is used to support more features.

Setting up a Caffe2 environment to use Glow via ONNXIFI can be tricky the first
time. The steps in this walkthrough show how to build all the required
@@ -17,7 +17,7 @@
#ifndef GLOW_IMPORTER_COMMONOPERATORLOADER_H
#define GLOW_IMPORTER_COMMONOPERATORLOADER_H

#include "onnx/onnxifi.h"
#include "foxi/onnxifi.h"

#include "glow/Importer/ProtobufLoader.h"

@@ -17,7 +17,7 @@
#ifndef GLOW_IMPORTER_ONNXIFIMODELLOADER_H
#define GLOW_IMPORTER_ONNXIFIMODELLOADER_H

#include "onnx/onnxifi.h"
#include "foxi/onnxifi.h"

#include "glow/Importer/ONNXModelLoader.h"

@@ -9,7 +9,7 @@ if(NOT TARGET onnx_proto)
set(ONNX_NAMESPACE "glow_onnx")
endif()
add_definitions("-DONNX_NAMESPACE=${ONNX_NAMESPACE}")
add_subdirectory(${GLOW_THIRDPARTY_DIR}/onnx EXCLUDE_FROM_ALL build)
add_subdirectory(${GLOW_THIRDPARTY_DIR}/onnx EXCLUDE_FROM_ALL build_onnx)
endif()

find_package(Protobuf REQUIRED)
@@ -37,7 +37,7 @@ add_library(Importer
ONNXIFIModelLoader.cpp
${CAFFE_SRCS}
${GLOW_BINARY_DIR}/caffe2/proto/caffe2.pb.h)
target_include_directories(Importer PUBLIC ${ONNX_INCLUDE_DIRS})
target_include_directories(Importer PUBLIC ${ONNX_INCLUDE_DIRS} ${GLOW_THIRDPARTY_DIR}/foxi)
target_compile_definitions(Importer
INTERFACE
-DGOOGLE_PROTOBUF_NO_RTTI)
@@ -21,8 +21,8 @@
#include "glow/Importer/ONNXIFIModelLoader.h"
#include "glow/Support/ThreadPool.h"

#include "onnx/onnxifi.h"
#include "onnx/onnxifi_ext.h"
#include "foxi/onnxifi.h"
#include "foxi/onnxifi_ext.h"

#include <atomic>
#include <condition_variable>
@@ -31,7 +31,7 @@
* Documentation on the functions implementing onnxifi interface in
* this file is very shallow.
* Please see more documentation on functions that need to be
* implemented: https://github.com/onnx/onnx/blob/master/onnx/onnxifi.h.
* implemented: https://github.com/houseroad/foxi/blob/master/foxi/onnxifi.h.
*/

/// Return stable IDs of available backends on the system.
Submodule foxi added at 398135

0 comments on commit 37ebe41

Please sign in to comment.
You can’t perform that action at this time.