mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-07 12:21:27 +01:00
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/57366 We often get error messages such as ``` Model failed AOT (glow ahead-of-time compilation) with exception: Error during AOT optimization (non-provisioned addNetwork): Non-recoverable device error when adding network: Error code: PARTITIONER_ERROR Error message: Did not find a partition with an SLS node Error return stack: -------------------------------------------------------------------------------- glow/glow/lib/Partitioner/Partitioner.cpp:1244 -------------------------------------------------------------------------------- glow/glow/lib/Runtime/HostManager/HostManager.cpp:375 -------------------------------------------------------------------------------- ``` This makes the error message more clear by checking for the number of OnnixifiOp created before going into Glow. The check is enabled with the `verify_only_single_subnet` flag, and is disabled by default. Test Plan: Unit tests pass Reviewed By: khabinov Differential Revision: D28097674 fbshipit-source-id: 0eefd8f6ec1a82546b759be8e541256bf271a673
24 lines
586 B
C++
24 lines
586 B
C++
#pragma once
|
|
|
|
#include "caffe2/core/common.h"
|
|
#include "caffe2/proto/caffe2_pb.h"
|
|
#include "nomnigraph/Representations/NeuralNet.h"
|
|
|
|
#include <functional>
|
|
|
|
namespace caffe2 {
|
|
namespace opt {
|
|
struct CutResult {
|
|
caffe2::NetDef net;
|
|
int numberOfSubnets{0};
|
|
};
|
|
|
|
TORCH_API void DumpGraph(nom::repr::NNGraph* g, const std::string& fname);
|
|
TORCH_API CutResult OptimizeForBackend(
|
|
caffe2::NetDef& net,
|
|
std::function<bool(const caffe2::OperatorDef&)> supports,
|
|
std::function<caffe2::NetDef(const caffe2::NetDef&)> transform_func,
|
|
bool debug = false);
|
|
}
|
|
} // namespace caffe2
|