Closed cjvolzka closed 2 months ago
@cjvolzka @mikeessen I confirmed gpt2 optset 13 runs without segfault by using PR #2865. Could you double-check it? I hope other gpt-2 models run.
I also confirmed gpt2-xl with Opset 17 runs correctly without segfault.
I ran through all the variations and confirmed I was able to successfully compile and run the model variants. Thanks for the fix @imaihal!
Running the HuggingFace openai-community/gpt2 (and gpt2-large and gpt2-xl variants) compiles but returns a segfault when run on CPU. The model runs fine when compiled for NNPA.
Reproduce
Export Model
I converted the models to onnx using the Hugging Face optimum-cli. The optimum-cli does not work on s390x so I converted the model on my Mac and then transferred the exported model to a Linux on Z host to compile it.
Change
model_name
togpt-large
, etc to export other variantsCompile Mode
And afterward compiled the model with
--O3 --EmitLib --mtriple=s390x-ibm-loz --mcpu=z14 model.onnx --onnx-op-stats TXT --profile-ir=Onnx
--O3 --EmitLib --mtriple=s390x-ibm-loz --mcpu=z16 --maccel=NNPA model.onnx --onnx-op-stats TXT --profile-ir=ZHigh
Run model
I used a C++ client to run the model. For the inputs, I encoded the second paragraph of Les Miserables (see inputs.txt for values used)
The models compiled for NNPA (except gpt2-xl, optset 13) run without issue. The CPU compiled version (and gpt2-xl, opset 13, NNPA) appear to fail at the same spot based on the profile output:
Variant results: