Skip to content

[Slice node] Add support for steps attribute #3987

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
ponnamsairam opened this issue Jan 8, 2020 · 1 comment
Open

[Slice node] Add support for steps attribute #3987

ponnamsairam opened this issue Jan 8, 2020 · 1 comment
Labels
onnx ONNX support related issues

Comments

@ponnamsairam
Copy link

ponnamsairam commented Jan 8, 2020

Hey ,
we converted a word language model(Pytorch Model) having LSTM to ONNX format
when we are trying to compile this model with model-compiler we are getting this kind of error
it will be helpful if we get any suggestions!

./bin/model-compiler -m /home/sairam/wordmodel.onnx -emit-bundle=/home/sairam -backend=CPU
WARNING: Logging before InitGoogleLogging() is written to STDERR
F0108 15:51:33.261059 8809 Error.cpp:119] exitOnError(Error) got an unexpected ErrorValue:
Error message: Steps is not currently supported.
Error return stack:
/home/glow/lib/Importer/ONNXModelLoader.cpp:482
/home/glow/lib/Importer/ONNXModelLoader.cpp:2309
/home/glow/lib/Importer/ONNXModelLoader.cpp:2402
/home/glow/lib/Importer/ONNXModelLoader.cpp:2416
*** Check failure stack trace: ***
#0 0x00000000007d515a llvm::sys::PrintStackTrace(llvm::raw_ostream&) (./bin/model-compiler+0x7d515a)
#1 0x00000000007d30ec llvm::sys::RunSignalHandlers() (./bin/model-compiler+0x7d30ec)
#2 0x00000000007d3257 SignalHandler(int) (./bin/model-compiler+0x7d3257)
#3 0x00007f627ae3e390 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x11390)
#4 0x00007f6279fc8428 gsignal (/lib/x86_64-linux-gnu/libc.so.6+0x35428)
#5 0x00007f6279fca02a abort (/lib/x86_64-linux-gnu/libc.so.6+0x3702a)
#6 0x00007f627ac07e49 (/usr/lib/x86_64-linux-gnu/libglog.so.0+0x9e49)
#7 0x00007f627ac095cd (/usr/lib/x86_64-linux-gnu/libglog.so.0+0xb5cd)
#8 0x00007f627ac0b433 google::LogMessage::SendToLog() (/usr/lib/x86_64-linux-gnu/libglog.so.0+0xd433)
#9 0x00007f627ac0915b google::LogMessage::Flush() (/usr/lib/x86_64-linux-gnu/libglog.so.0+0xb15b)
#10 0x00007f627ac0be1e google::LogMessageFatal::~LogMessageFatal() (/usr/lib/x86_64-linux-gnu/libglog.so.0+0xde1e)
#11 0x000000000279929c glow::detail::exitOnError(char const*, unsigned long, glow::detail::GlowError) /home/tcs/glow/lib/Support/Error.cpp:122:0
#12 0x00000000006c9463 glow::ONNXModelLoader::ONNXModelLoader(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, llvm::ArrayRef<char const*>, llvm::ArrayRef<glow::Type const*>, glow::Function&, glow::detail::GlowError*, bool) /home/tcs/glow/lib/Importer/ONNXModelLoader.cpp:2416:0
#13 0x000000000051777b main /home/tcs/glow/tools/loader/ModelCompiler.cpp:59:0
#14 0x00007f6279fb3830 __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x20830)
#15 0x00000000004ee089 _start (./bin/model-compiler+0x4ee089)
Aborted (core dumped)
@mciprian13

@jfix71
Copy link
Contributor

jfix71 commented Jan 8, 2020

Hi @ponnamsairam, We do not currently support steps for ONNX's Slice. To fix this, support needs to be added here instead of the error message:

RETURN_ERR_IF_NOT(op.input_size() == 5,
"Steps is not currently supported.");

@opti-mix opti-mix added the onnx ONNX support related issues label Jan 22, 2020
facebook-github-bot pushed a commit that referenced this issue Apr 7, 2021
Summary:
Support step attribute in slice node when loading ONNX format. Although it succeeds to load ONNX format having slice node with step attribute, it does not support non-1 step values. Since it should be rare to use non-1 step values for major machine learning models, we may want to prioritize loading major models such as YOLO, LSTM.

See: #3987

Pull Request resolved: #5454

Test Plan: Added two test cases passing slice node with the default steps (all having 1s) and slice node with non-1 step attributes.

Reviewed By: jackm321

Differential Revision: D27598418

Pulled By: jfix71

fbshipit-source-id: f4e51d69772f5f633c6173bdc5aea60f89b51dac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
onnx ONNX support related issues
Projects
None yet
Development

No branches or pull requests

3 participants