[api] add API for exporting model as c++ source (#1341) #548
84 tests run, 8 passed, 58 skipped, 18 failed.
Annotations
Check failure on line 46 in forge/test/models/pytorch/audio/stereo/test_stereo.py
github-actions / TT-Forge-FE Tests
test_stereo.test_stereo[facebook/musicgen-small]
RuntimeError: TT_ASSERT @ /__w/tt-forge-fe/tt-forge-fe/forge/csrc/graph_lib/shape.cpp:135: (i >= 0) && (i < (int)dims_.size())
info:
Trying to access element outside of dimensions: 3
backtrace:
--- tt::graphlib::Shape::operator[](int)
--- tt::passes::commute_through_concat(tt::graphlib::Graph*, tt::graphlib::OpNode*, tt::graphlib::OpNode*, tt::graphlib::Node*, tt::graphlib::Shape*, tt::graphlib::Shape*, bool, bool*, std::pair<int, int>*, tt::graphlib::OpType*, bool)
--- tt::passes::can_commute_past_op(tt::graphlib::OpNode*, tt::graphlib::OpNode*, tt::graphlib::Graph*, tt::graphlib::Shape*, tt::graphlib::Shape*, bool, tt::graphlib::Node*)
--- /opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/_C.so(+0x1928ef) [0x7ff7d5ed28ef]
--- tt::passes::erase_inverse_ops(tt::graphlib::Graph*)
--- tt::run_optimization_graph_passes(tt::graphlib::Graph*)
--- /opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/_C.so(+0xfeca9) [0x7ff7d5e3eca9]
--- /opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/_C.so(+0xe1e05) [0x7ff7d5e21e05]
--- /opt/ttforge-toolchain/venv/bin/python(+0x18ab32) [0x5612acea7b32]
--- /opt/ttforge-toolchain/venv/bin/python(_PyObject_MakeTpCall+0x25b) [0x5612ace9e39b]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x59c7) [0x5612ace97a97]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x6c0) [0x5612ace92790]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x6c0) [0x5612ace92790]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x18db) [0x5612ace939ab]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
--- /opt/ttforge-toolchain/venv/bin/python(PyObject_Call+0x122) [0x5612aceb6172]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2b60) [0x5612ace94c30]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2b60) [0x5612ace94c30]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x18db) [0x5612ace939ab]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x5632) [0x5612ace97702]
--- /opt/ttforge-toolchain/venv/bin/python(+0x1984d1) [0x5612aceb54d1]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x5632) [0x5612ace97702]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyObject_FastCallDictTstate+0x16d) [0x5612ace9d61d]
--- /opt/ttforge-toolchain/venv/bin/python(_PyObject_Call_Prepend+0x5c) [0x5612aceb262c]
--- /opt/ttforge-toolchain/venv/bin/python(+0x29d464) [0x5612acfba464]
--- /opt/ttforge-toolchain/venv/bin/python(_PyObject_MakeTpCall+0x25b) [0x5612ace9e39b]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x68ce) [0x5612ace9899e]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x8af) [0x5612ace9297f]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2b60) [0x5612ace94c30]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x18db) [0x5612ace939ab]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x5632) [0x5612ace97702]
--- /opt/ttforge-toolchain/venv/bin/python(+0x1984d1) [0x5612aceb54d1]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x5632) [0x5612ace97702]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyObject_FastCallDictTstate+0x16d) [0x5612ace9d61d]
--- /opt/ttforge-toolchain/venv/bin/python(_PyObject_Call_Prepend+0x5c) [0x5612aceb262c]
--- /opt/ttforge-toolchain/venv/bin/python(+0x29d464) [0x5612acfba464]
--- /opt/ttforge-toolchain/venv/bin/python(PyObject_Call+0xbb) [0x5612aceb610b]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2b60) [0x5612ace94c30]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x6c0) [0x5612ace92790]
--- /opt/ttforge-toolchain/venv/bin/python(+0x1984d1) [0x5612aceb54d1]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x18db) [0x5612ace939ab]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2b60) [0x5612ace94c30]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x6c0) [0x5612ace92790]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x18db) [0x5612ace939ab]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2b60) [0x5612ace94c30]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x18db) [0x5612ace939ab]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x5632) [0x5612ace97702]
--- /opt/ttforge-toolchain/venv/bin/python(+0x1984d1) [0x5612aceb54d1]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x5632) [0x5612ace97702]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyObject_FastCallDictTstate+0x16d) [0x5612ace9d61d]
--- /opt/ttforge-toolchain/venv/bin/python(_PyObject_Call_Prepend+0x5c) [0x5612aceb262c]
--- /opt/ttforge-toolchain/venv/bin/python(+0x29d464) [0x5612acfba464]
--- /opt/ttforge-toolchain/venv/bin/python(_PyObject_MakeTpCall+0x25b) [0x5612ace9e39b]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x68ce) [0x5612ace9899e]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2b60) [0x5612ace94c30]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x18db) [0x5612ace939ab]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x5632) [0x5612ace97702]
--- /opt/ttforge-toolchain/venv/bin/python(+0x1984d1) [0x5612aceb54d1]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x5632) [0x5612ace97702]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyObject_FastCallDictTstate+0x16d) [0x5612ace9d61d]
--- /opt/ttforge-toolchain/venv/bin/python(_PyObject_Call_Prepend+0x5c) [0x5612aceb262c]
--- /opt/ttforge-toolchain/venv/bin/python(+0x29d464) [0x5612acfba464]
--- /opt/ttforge-toolchain/venv/bin/python(_PyObject_MakeTpCall+0x25b) [0x5612ace9e39b]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x68ce) [0x5612ace9899e]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x6c0) [0x5612ace92790]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x6c0) [0x5612ace92790]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2b60) [0x5612ace94c30]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x18db) [0x5612ace939ab]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
Raw output
record_forge_property = <test.conftest.ForgePropertyStore object at 0x7ff78624abf0>
variant = 'facebook/musicgen-small'
@pytest.mark.nightly
@pytest.mark.parametrize("variant", variants)
def test_stereo(record_forge_property, variant):
if variant != "facebook/musicgen-small":
pytest.skip("Skipping due to the current CI/CD pipeline limitations")
# Build Module Name
module_name = build_module_name(
framework=Framework.PYTORCH,
model="stereo",
variant=variant,
task=Task.MUSIC_GENERATION,
source=Source.HUGGINGFACE,
)
# Record Forge Property
record_forge_property("tags.model_name", module_name)
framework_model, processor = load_model(variant)
input_ids, attn_mask, decoder_input_ids = load_inputs(framework_model, processor)
inputs = [input_ids, attn_mask, decoder_input_ids]
# Issue: https://github.com/tenstorrent/tt-forge-fe/issues/615
# Forge compile framework model
> compiled_model = forge.compile(framework_model, sample_inputs=inputs, module_name=module_name)
forge/test/models/pytorch/audio/stereo/test_stereo.py:46:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/compile.py:251: in compile_main
return forge_compile_from_context(compile_context)
/opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/compile.py:293: in forge_compile_from_context
next_stage = stage_to_func[current_stage](context)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
context = CompileContext(modules=[Module pt_stereo_facebook_musicgen_small_music_generation_hf], graph_name='pt_stereo_facebook_...in_recompile=False, recompile_count=0, target_cycles_offset=0, forge_module=None, compiled_binary=None, attach_to=None)
def run_optimization_pass(context: CompileContext) -> CompileDepth:
"""
Runs optimization passes.
Parameters
----------
context: CompileContext
Compile context
Returns
-------
CompileDepth - next compile stage
"""
compiler_cfg = context.compiler_cfg
graph_name = context.graph_name
graph, intermediate_tensors = context.graph, context.intermediate_tensors
> run_optimization_graph_passes(graph)
E RuntimeError: TT_ASSERT @ /__w/tt-forge-fe/tt-forge-fe/forge/csrc/graph_lib/shape.cpp:135: (i >= 0) && (i < (int)dims_.size())
E info:
E Trying to access element outside of dimensions: 3
E backtrace:
E --- tt::graphlib::Shape::operator[](int)
E --- tt::passes::commute_through_concat(tt::graphlib::Graph*, tt::graphlib::OpNode*, tt::graphlib::OpNode*, tt::graphlib::Node*, tt::graphlib::Shape*, tt::graphlib::Shape*, bool, bool*, std::pair<int, int>*, tt::graphlib::OpType*, bool)
E --- tt::passes::can_commute_past_op(tt::graphlib::OpNode*, tt::graphlib::OpNode*, tt::graphlib::Graph*, tt::graphlib::Shape*, tt::graphlib::Shape*, bool, tt::graphlib::Node*)
E --- /opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/_C.so(+0x1928ef) [0x7ff7d5ed28ef]
E --- tt::passes::erase_inverse_ops(tt::graphlib::Graph*)
E --- tt::run_optimization_graph_passes(tt::graphlib::Graph*)
E --- /opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/_C.so(+0xfeca9) [0x7ff7d5e3eca9]
E --- /opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/_C.so(+0xe1e05) [0x7ff7d5e21e05]
E --- /opt/ttforge-toolchain/venv/bin/python(+0x18ab32) [0x5612acea7b32]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_MakeTpCall+0x25b) [0x5612ace9e39b]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x59c7) [0x5612ace97a97]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x6c0) [0x5612ace92790]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x6c0) [0x5612ace92790]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x18db) [0x5612ace939ab]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
E --- /opt/ttforge-toolchain/venv/bin/python(PyObject_Call+0x122) [0x5612aceb6172]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2b60) [0x5612ace94c30]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2b60) [0x5612ace94c30]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x18db) [0x5612ace939ab]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x5632) [0x5612ace97702]
E --- /opt/ttforge-toolchain/venv/bin/python(+0x1984d1) [0x5612aceb54d1]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x5632) [0x5612ace97702]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_FastCallDictTstate+0x16d) [0x5612ace9d61d]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_Call_Prepend+0x5c) [0x5612aceb262c]
E --- /opt/ttforge-toolchain/venv/bin/python(+0x29d464) [0x5612acfba464]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_MakeTpCall+0x25b) [0x5612ace9e39b]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x68ce) [0x5612ace9899e]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x8af) [0x5612ace9297f]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2b60) [0x5612ace94c30]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x18db) [0x5612ace939ab]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x5632) [0x5612ace97702]
E --- /opt/ttforge-toolchain/venv/bin/python(+0x1984d1) [0x5612aceb54d1]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x5632) [0x5612ace97702]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_FastCallDictTstate+0x16d) [0x5612ace9d61d]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_Call_Prepend+0x5c) [0x5612aceb262c]
E --- /opt/ttforge-toolchain/venv/bin/python(+0x29d464) [0x5612acfba464]
E --- /opt/ttforge-toolchain/venv/bin/python(PyObject_Call+0xbb) [0x5612aceb610b]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2b60) [0x5612ace94c30]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x6c0) [0x5612ace92790]
E --- /opt/ttforge-toolchain/venv/bin/python(+0x1984d1) [0x5612aceb54d1]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x18db) [0x5612ace939ab]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2b60) [0x5612ace94c30]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x6c0) [0x5612ace92790]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x18db) [0x5612ace939ab]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2b60) [0x5612ace94c30]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x18db) [0x5612ace939ab]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x5632) [0x5612ace97702]
E --- /opt/ttforge-toolchain/venv/bin/python(+0x1984d1) [0x5612aceb54d1]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x5632) [0x5612ace97702]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_FastCallDictTstate+0x16d) [0x5612ace9d61d]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_Call_Prepend+0x5c) [0x5612aceb262c]
E --- /opt/ttforge-toolchain/venv/bin/python(+0x29d464) [0x5612acfba464]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_MakeTpCall+0x25b) [0x5612ace9e39b]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x68ce) [0x5612ace9899e]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2b60) [0x5612ace94c30]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x18db) [0x5612ace939ab]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x5632) [0x5612ace97702]
E --- /opt/ttforge-toolchain/venv/bin/python(+0x1984d1) [0x5612aceb54d1]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x5632) [0x5612ace97702]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_FastCallDictTstate+0x16d) [0x5612ace9d61d]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_Call_Prepend+0x5c) [0x5612aceb262c]
E --- /opt/ttforge-toolchain/venv/bin/python(+0x29d464) [0x5612acfba464]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_MakeTpCall+0x25b) [0x5612ace9e39b]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x68ce) [0x5612ace9899e]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x6c0) [0x5612ace92790]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x6c0) [0x5612ace92790]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2b60) [0x5612ace94c30]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x18db) [0x5612ace939ab]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
/opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/compile.py:829: RuntimeError
Check failure on line 53 in forge/test/models/pytorch/multimodal/clip/test_clip.py
github-actions / TT-Forge-FE Tests
test_clip.test_clip_pytorch[openai/clip-vit-base-patch32]
RuntimeError: Generated MLIR module failed verification.
Raw output
record_forge_property = <test.conftest.ForgePropertyStore object at 0x7ff632f3f940>
variant = 'openai/clip-vit-base-patch32'
@pytest.mark.nightly
@pytest.mark.parametrize("variant", ["openai/clip-vit-base-patch32"])
def test_clip_pytorch(record_forge_property, variant):
# Build Module Name
module_name = build_module_name(
framework=Framework.PYTORCH,
model="clip",
variant=variant,
suffix="text",
source=Source.HUGGINGFACE,
task=Task.TEXT_GENERATION,
)
# Record Forge Property
record_forge_property("tags.model_name", module_name)
# Load processor and model from HuggingFace
model = download_model(CLIPModel.from_pretrained, variant, torchscript=True)
processor = download_model(CLIPProcessor.from_pretrained, variant)
# Load image from the IAM dataset
url = "http://images.cocodataset.org/val2017/000000039769.jpg"
image = Image.open(requests.get(url, stream=True).raw)
# Process image
text = [
"a photo of a cat",
"a photo of a dog",
]
inputs = processor(text=text, images=image, return_tensors="pt")
inputs = [inputs["input_ids"], inputs["pixel_values"], inputs["attention_mask"]]
framework_model = CLIPTextWrapper(model)
inputs = [inputs[0], inputs[2]]
# Forge compile framework model
> compiled_model = forge.compile(framework_model, sample_inputs=inputs, module_name=module_name)
forge/test/models/pytorch/multimodal/clip/test_clip.py:53:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/compile.py:251: in compile_main
return forge_compile_from_context(compile_context)
/opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/compile.py:293: in forge_compile_from_context
next_stage = stage_to_func[current_stage](context)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
context = CompileContext(modules=[Module pt_clip_openai_clip_vit_base_patch32_text_gen_hf_text], graph_name='pt_clip_openai_clip...cles_offset=0, forge_module=<forge._C.ForgeGraphModule object at 0x7ff777748630>, compiled_binary=None, attach_to=None)
def run_mlir_compiler(context: CompileContext) -> CompileDepth:
assert context.forge_module is not None
> context.compiled_binary = forge._C.run_mlir_compiler(context.forge_module)
E RuntimeError: Generated MLIR module failed verification.
/opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/compile.py:986: RuntimeError
github-actions / TT-Forge-FE Tests
test_stable_diffusion_xl.test_stable_diffusion_generation[stable-diffusion-xl-base-1.0]
NotImplementedError: Unknown output type: <class 'PIL.Image.Image'>
Raw output
record_forge_property = <test.conftest.ForgePropertyStore object at 0x7ff62e708b50>
variant = 'stable-diffusion-xl-base-1.0'
@pytest.mark.nightly
@pytest.mark.skip_model_analysis
@pytest.mark.parametrize("variant", ["stable-diffusion-xl-base-1.0"])
def test_stable_diffusion_generation(record_forge_property, variant):
# Build Module Name
module_name = build_module_name(
framework=Framework.PYTORCH,
model="stereo",
variant=variant,
task=Task.MUSIC_GENERATION,
source=Source.HUGGINGFACE,
)
# Record Forge Property
record_forge_property("tags.model_name", module_name)
# Load the pipeline and set it to use the CPU
pipe = DiffusionPipeline.from_pretrained(f"stabilityai/{variant}", torch_dtype=torch.float32) # Use float32 for CPU
pipe.to("cpu") # Move the model to CPU
# Wrap the pipeline in the wrapper
framework_model = StableDiffusionXLWrapper(pipe)
# Tokenize the prompt to a tensor
tokenizer = pipe.tokenizer
prompt = "An astronaut riding a green horse"
input_tensor = tokenizer(prompt, return_tensors="pt").input_ids
inputs = [input_tensor]
# Forge compile framework model
> compiled_model = forge.compile(framework_model, sample_inputs=inputs, module_name=module_name)
forge/test/models/pytorch/multimodal/stable_diffusion/test_stable_diffusion_xl.py:64:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/compile.py:251: in compile_main
return forge_compile_from_context(compile_context)
/opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/compile.py:293: in forge_compile_from_context
next_stage = stage_to_func[current_stage](context)
/opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/compile.py:672: in generate_initial_graph
module, module_inputs = convert_to_forge_module(
/opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/compile.py:1033: in convert_to_forge_module
forge_module, dev_types, module_inputs = generate_forge_module(
/opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/tvm_to_python.py:2060: in generate_forge_module
framework_outputs = framework_mod.cpu_eval_forward(*pytorch_inputs)
/opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/module.py:142: in cpu_eval_forward
outputs = flatten_structured_output([outputs])
/opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/tvm_utils.py:112: in flatten_structured_output
sub_output = flatten_structured_output(
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
outputs = [<PIL.Image.Image image mode=RGB size=1024x1024 at 0x7FF778CFD120>]
def flatten_structured_output(outputs):
from forge.tensor import Tensor
new_outputs = []
for i in range(len(outputs)):
out = outputs[i]
if isinstance(out, (list, tuple)):
sub_output = flatten_structured_output(
out,
)
new_outputs += sub_output
elif isinstance(out, dict):
sub_output = []
for k, v in out.items():
sub_output.append(v)
sub_output = flatten_structured_output(
sub_output,
)
new_outputs += sub_output
elif isinstance(out, (torch.Tensor, tf.Tensor, Tensor, np.ndarray)):
new_outputs.append(out)
elif out is None:
continue
else:
> raise NotImplementedError(f"Unknown output type: {type(out)}")
E NotImplementedError: Unknown output type: <class 'PIL.Image.Image'>
/opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/tvm_utils.py:133: NotImplementedError
Check failure on line 59 in forge/test/models/pytorch/text/distilbert/test_distilbert.py
github-actions / TT-Forge-FE Tests
test_distilbert.test_distilbert_masked_lm_pytorch[distilbert-base-uncased]
RuntimeError: Generated MLIR module failed verification.
Raw output
record_forge_property = <test.conftest.ForgePropertyStore object at 0x7ff778cb7370>
variant = 'distilbert-base-uncased'
@pytest.mark.nightly
@pytest.mark.parametrize("variant", variants, ids=variants)
def test_distilbert_masked_lm_pytorch(record_forge_property, variant):
if variant != "distilbert-base-uncased":
pytest.skip("Skipping due to the current CI/CD pipeline limitations")
# Build Module Name
module_name = build_module_name(
framework=Framework.PYTORCH, model="distilbert", variant=variant, task=Task.MASKED_LM, source=Source.HUGGINGFACE
)
# Record Forge Property
record_forge_property("tags.model_name", module_name)
# Load DistilBert tokenizer and model from HuggingFace
# Variants: distilbert-base-uncased, distilbert-base-cased,
# distilbert-base-multilingual-cased
# NOTE: These model variants are pre-trined only. They need to be fine-tuned
# on a downstream task. Code is for demonstration purposes only.
tokenizer = download_model(DistilBertTokenizer.from_pretrained, variant)
framework_model = download_model(DistilBertForMaskedLM.from_pretrained, variant)
# Load data sample
sample_text = "The capital of France is [MASK]."
# Data preprocessing
input_tokens = tokenizer(
sample_text,
max_length=128,
padding="max_length",
truncation=True,
return_tensors="pt",
)
inputs = [input_tokens["input_ids"], input_tokens["attention_mask"]]
# Forge compile framework model
> compiled_model = forge.compile(framework_model, sample_inputs=inputs, module_name=module_name)
forge/test/models/pytorch/text/distilbert/test_distilbert.py:59:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/compile.py:251: in compile_main
return forge_compile_from_context(compile_context)
/opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/compile.py:293: in forge_compile_from_context
next_stage = stage_to_func[current_stage](context)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
context = CompileContext(modules=[Module pt_distilbert_distilbert_base_uncased_mlm_hf], graph_name='pt_distilbert_distilbert_bas...cles_offset=0, forge_module=<forge._C.ForgeGraphModule object at 0x7ff85c37ce30>, compiled_binary=None, attach_to=None)
def run_mlir_compiler(context: CompileContext) -> CompileDepth:
assert context.forge_module is not None
> context.compiled_binary = forge._C.run_mlir_compiler(context.forge_module)
E RuntimeError: Generated MLIR module failed verification.
/opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/compile.py:986: RuntimeError
Check failure on line 76 in forge/test/models/pytorch/text/fuyu/test_fuyu_8b.py
github-actions / TT-Forge-FE Tests
test_fuyu_8b.test_fuyu8b[adept/fuyu-8b]
RuntimeError: TT_ASSERT @ /__w/tt-forge-fe/tt-forge-fe/forge/csrc/graph_lib/shape.cpp:135: (i >= 0) && (i < (int)dims_.size())
info:
Trying to access element outside of dimensions: 3
backtrace:
--- tt::graphlib::Shape::operator[](int)
--- tt::passes::commute_through_concat(tt::graphlib::Graph*, tt::graphlib::OpNode*, tt::graphlib::OpNode*, tt::graphlib::Node*, tt::graphlib::Shape*, tt::graphlib::Shape*, bool, bool*, std::pair<int, int>*, tt::graphlib::OpType*, bool)
--- tt::passes::can_commute_past_op(tt::graphlib::OpNode*, tt::graphlib::OpNode*, tt::graphlib::Graph*, tt::graphlib::Shape*, tt::graphlib::Shape*, bool, tt::graphlib::Node*)
--- /opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/_C.so(+0x1928ef) [0x7ff7d5ed28ef]
--- /opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/_C.so(+0x192a3d) [0x7ff7d5ed2a3d]
--- /opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/_C.so(+0x192a3d) [0x7ff7d5ed2a3d]
--- /opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/_C.so(+0x192a3d) [0x7ff7d5ed2a3d]
--- tt::passes::erase_inverse_ops(tt::graphlib::Graph*)
--- tt::run_optimization_graph_passes(tt::graphlib::Graph*)
--- /opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/_C.so(+0xfeca9) [0x7ff7d5e3eca9]
--- /opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/_C.so(+0xe1e05) [0x7ff7d5e21e05]
--- /opt/ttforge-toolchain/venv/bin/python(+0x18ab32) [0x5612acea7b32]
--- /opt/ttforge-toolchain/venv/bin/python(_PyObject_MakeTpCall+0x25b) [0x5612ace9e39b]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x59c7) [0x5612ace97a97]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x6c0) [0x5612ace92790]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x6c0) [0x5612ace92790]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x18db) [0x5612ace939ab]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
--- /opt/ttforge-toolchain/venv/bin/python(PyObject_Call+0x122) [0x5612aceb6172]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2b60) [0x5612ace94c30]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2b60) [0x5612ace94c30]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x18db) [0x5612ace939ab]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x5632) [0x5612ace97702]
--- /opt/ttforge-toolchain/venv/bin/python(+0x1984d1) [0x5612aceb54d1]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x5632) [0x5612ace97702]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyObject_FastCallDictTstate+0x16d) [0x5612ace9d61d]
--- /opt/ttforge-toolchain/venv/bin/python(_PyObject_Call_Prepend+0x5c) [0x5612aceb262c]
--- /opt/ttforge-toolchain/venv/bin/python(+0x29d464) [0x5612acfba464]
--- /opt/ttforge-toolchain/venv/bin/python(_PyObject_MakeTpCall+0x25b) [0x5612ace9e39b]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x68ce) [0x5612ace9899e]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x8af) [0x5612ace9297f]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2b60) [0x5612ace94c30]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x18db) [0x5612ace939ab]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x5632) [0x5612ace97702]
--- /opt/ttforge-toolchain/venv/bin/python(+0x1984d1) [0x5612aceb54d1]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x5632) [0x5612ace97702]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyObject_FastCallDictTstate+0x16d) [0x5612ace9d61d]
--- /opt/ttforge-toolchain/venv/bin/python(_PyObject_Call_Prepend+0x5c) [0x5612aceb262c]
--- /opt/ttforge-toolchain/venv/bin/python(+0x29d464) [0x5612acfba464]
--- /opt/ttforge-toolchain/venv/bin/python(PyObject_Call+0xbb) [0x5612aceb610b]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2b60) [0x5612ace94c30]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x6c0) [0x5612ace92790]
--- /opt/ttforge-toolchain/venv/bin/python(+0x1984d1) [0x5612aceb54d1]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x18db) [0x5612ace939ab]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2b60) [0x5612ace94c30]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x6c0) [0x5612ace92790]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x18db) [0x5612ace939ab]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2b60) [0x5612ace94c30]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x18db) [0x5612ace939ab]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x5632) [0x5612ace97702]
--- /opt/ttforge-toolchain/venv/bin/python(+0x1984d1) [0x5612aceb54d1]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x5632) [0x5612ace97702]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyObject_FastCallDictTstate+0x16d) [0x5612ace9d61d]
--- /opt/ttforge-toolchain/venv/bin/python(_PyObject_Call_Prepend+0x5c) [0x5612aceb262c]
--- /opt/ttforge-toolchain/venv/bin/python(+0x29d464) [0x5612acfba464]
--- /opt/ttforge-toolchain/venv/bin/python(_PyObject_MakeTpCall+0x25b) [0x5612ace9e39b]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x68ce) [0x5612ace9899e]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2b60) [0x5612ace94c30]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x18db) [0x5612ace939ab]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x5632) [0x5612ace97702]
--- /opt/ttforge-toolchain/venv/bin/python(+0x1984d1) [0x5612aceb54d1]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x5632) [0x5612ace97702]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyObject_FastCallDictTstate+0x16d) [0x5612ace9d61d]
--- /opt/ttforge-toolchain/venv/bin/python(_PyObject_Call_Prepend+0x5c) [0x5612aceb262c]
--- /opt/ttforge-toolchain/venv/bin/python(+0x29d464) [0x5612acfba464]
--- /opt/ttforge-toolchain/venv/bin/python(_PyObject_MakeTpCall+0x25b) [0x5612ace9e39b]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x68ce) [0x5612ace9899e]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x6c0) [0x5612ace92790]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x6c0) [0x5612ace92790]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2b60) [0x5612ace94c30]
Raw output
record_forge_property = <test.conftest.ForgePropertyStore object at 0x7ff778bed5a0>
variant = 'adept/fuyu-8b'
@pytest.mark.nightly
@pytest.mark.parametrize("variant", ["adept/fuyu-8b"])
def test_fuyu8b(record_forge_property, variant):
# Build Module Name
module_name = build_module_name(
framework=Framework.PYTORCH, model="fuyu", variant=variant, task=Task.QA, source=Source.HUGGINGFACE
)
# Record Forge Property
record_forge_property("tags.model_name", module_name)
config = FuyuConfig.from_pretrained(variant)
config_dict = config.to_dict()
config_dict["return_dict"] = False
config_dict["use_cache"] = False
config_dict["text_config"]["num_hidden_layers"] = 1
config = FuyuConfig(**config_dict)
# Load post-processing modules (run on CPU)
tokenizer = AutoTokenizer.from_pretrained(variant)
image_processor = FuyuImageProcessor()
processor = FuyuProcessor(image_processor=image_processor, tokenizer=tokenizer)
# Create Forge module from PyTorch model
fuyu_model = FuyuForCausalLM.from_pretrained(variant, config=config)
# fuyu_model = FuyuForCausalLM(config=config)
framework_model = FuyuModelWrapper(fuyu_model)
framework_model.eval()
# Prepare inputs
text_prompt = "Generate a coco-style caption.\n"
url = "https://huggingface.co/adept-hf-collab/fuyu-8b/resolve/main/bus.png"
response = requests.get(url)
with open("bus.png", "wb") as file:
file.write(response.content)
image_path = "bus.png" # https://huggingface.co/adept-hf-collab/fuyu-8b/blob/main/bus.png
image_pil = Image.open(image_path)
model_inputs = processor(text=text_prompt, images=[image_pil], device="cpu", return_tensor="pt")
inputs_embeds = generate_fuyu_embedding(
fuyu_model, model_inputs["input_ids"], model_inputs["image_patches"][0], model_inputs["image_patches_indices"]
)
inputs_embeds = inputs_embeds.clone().detach()
inputs = [inputs_embeds]
# Forge compile framework model
> compiled_model = forge.compile(framework_model, sample_inputs=inputs, module_name=module_name)
forge/test/models/pytorch/text/fuyu/test_fuyu_8b.py:76:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/compile.py:251: in compile_main
return forge_compile_from_context(compile_context)
/opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/compile.py:293: in forge_compile_from_context
next_stage = stage_to_func[current_stage](context)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
context = CompileContext(modules=[Module pt_fuyu_adept_fuyu_8b_qa_hf], graph_name='pt_fuyu_adept_fuyu_8b_qa_hf', compiler_cfg=Co...in_recompile=False, recompile_count=0, target_cycles_offset=0, forge_module=None, compiled_binary=None, attach_to=None)
def run_optimization_pass(context: CompileContext) -> CompileDepth:
"""
Runs optimization passes.
Parameters
----------
context: CompileContext
Compile context
Returns
-------
CompileDepth - next compile stage
"""
compiler_cfg = context.compiler_cfg
graph_name = context.graph_name
graph, intermediate_tensors = context.graph, context.intermediate_tensors
> run_optimization_graph_passes(graph)
E RuntimeError: TT_ASSERT @ /__w/tt-forge-fe/tt-forge-fe/forge/csrc/graph_lib/shape.cpp:135: (i >= 0) && (i < (int)dims_.size())
E info:
E Trying to access element outside of dimensions: 3
E backtrace:
E --- tt::graphlib::Shape::operator[](int)
E --- tt::passes::commute_through_concat(tt::graphlib::Graph*, tt::graphlib::OpNode*, tt::graphlib::OpNode*, tt::graphlib::Node*, tt::graphlib::Shape*, tt::graphlib::Shape*, bool, bool*, std::pair<int, int>*, tt::graphlib::OpType*, bool)
E --- tt::passes::can_commute_past_op(tt::graphlib::OpNode*, tt::graphlib::OpNode*, tt::graphlib::Graph*, tt::graphlib::Shape*, tt::graphlib::Shape*, bool, tt::graphlib::Node*)
E --- /opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/_C.so(+0x1928ef) [0x7ff7d5ed28ef]
E --- /opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/_C.so(+0x192a3d) [0x7ff7d5ed2a3d]
E --- /opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/_C.so(+0x192a3d) [0x7ff7d5ed2a3d]
E --- /opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/_C.so(+0x192a3d) [0x7ff7d5ed2a3d]
E --- tt::passes::erase_inverse_ops(tt::graphlib::Graph*)
E --- tt::run_optimization_graph_passes(tt::graphlib::Graph*)
E --- /opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/_C.so(+0xfeca9) [0x7ff7d5e3eca9]
E --- /opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/_C.so(+0xe1e05) [0x7ff7d5e21e05]
E --- /opt/ttforge-toolchain/venv/bin/python(+0x18ab32) [0x5612acea7b32]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_MakeTpCall+0x25b) [0x5612ace9e39b]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x59c7) [0x5612ace97a97]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x6c0) [0x5612ace92790]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x6c0) [0x5612ace92790]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x18db) [0x5612ace939ab]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
E --- /opt/ttforge-toolchain/venv/bin/python(PyObject_Call+0x122) [0x5612aceb6172]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2b60) [0x5612ace94c30]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2b60) [0x5612ace94c30]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x18db) [0x5612ace939ab]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x5632) [0x5612ace97702]
E --- /opt/ttforge-toolchain/venv/bin/python(+0x1984d1) [0x5612aceb54d1]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x5632) [0x5612ace97702]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_FastCallDictTstate+0x16d) [0x5612ace9d61d]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_Call_Prepend+0x5c) [0x5612aceb262c]
E --- /opt/ttforge-toolchain/venv/bin/python(+0x29d464) [0x5612acfba464]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_MakeTpCall+0x25b) [0x5612ace9e39b]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x68ce) [0x5612ace9899e]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x8af) [0x5612ace9297f]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2b60) [0x5612ace94c30]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x18db) [0x5612ace939ab]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x5632) [0x5612ace97702]
E --- /opt/ttforge-toolchain/venv/bin/python(+0x1984d1) [0x5612aceb54d1]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x5632) [0x5612ace97702]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_FastCallDictTstate+0x16d) [0x5612ace9d61d]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_Call_Prepend+0x5c) [0x5612aceb262c]
E --- /opt/ttforge-toolchain/venv/bin/python(+0x29d464) [0x5612acfba464]
E --- /opt/ttforge-toolchain/venv/bin/python(PyObject_Call+0xbb) [0x5612aceb610b]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2b60) [0x5612ace94c30]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x6c0) [0x5612ace92790]
E --- /opt/ttforge-toolchain/venv/bin/python(+0x1984d1) [0x5612aceb54d1]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x18db) [0x5612ace939ab]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2b60) [0x5612ace94c30]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x6c0) [0x5612ace92790]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x18db) [0x5612ace939ab]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2b60) [0x5612ace94c30]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x18db) [0x5612ace939ab]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x5632) [0x5612ace97702]
E --- /opt/ttforge-toolchain/venv/bin/python(+0x1984d1) [0x5612aceb54d1]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x5632) [0x5612ace97702]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_FastCallDictTstate+0x16d) [0x5612ace9d61d]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_Call_Prepend+0x5c) [0x5612aceb262c]
E --- /opt/ttforge-toolchain/venv/bin/python(+0x29d464) [0x5612acfba464]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_MakeTpCall+0x25b) [0x5612ace9e39b]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x68ce) [0x5612ace9899e]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2b60) [0x5612ace94c30]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x18db) [0x5612ace939ab]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x5632) [0x5612ace97702]
E --- /opt/ttforge-toolchain/venv/bin/python(+0x1984d1) [0x5612aceb54d1]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x5632) [0x5612ace97702]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_FastCallDictTstate+0x16d) [0x5612ace9d61d]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_Call_Prepend+0x5c) [0x5612aceb262c]
E --- /opt/ttforge-toolchain/venv/bin/python(+0x29d464) [0x5612acfba464]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_MakeTpCall+0x25b) [0x5612ace9e39b]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x68ce) [0x5612ace9899e]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x6c0) [0x5612ace92790]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x6c0) [0x5612ace92790]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2b60) [0x5612ace94c30]
/opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/compile.py:829: RuntimeError
Check failure on line 55 in forge/test/models/pytorch/text/gpt2/test_gpt2.py
github-actions / TT-Forge-FE Tests
test_gpt2.test_gpt2_text_gen[gpt2]
RuntimeError: Tensor 6 - data type mismatch: expected Float32, got UInt8
Raw output
record_forge_property = <test.conftest.ForgePropertyStore object at 0x7ff778c1d930>
variant = 'gpt2'
@pytest.mark.nightly
@pytest.mark.parametrize("variant", ["gpt2"])
def test_gpt2_text_gen(record_forge_property, variant):
# Build Module Name
module_name = build_module_name(
framework=Framework.PYTORCH, model="gpt2", variant=variant, task=Task.TEXT_GENERATION, source=Source.HUGGINGFACE
)
# Record Forge Property
record_forge_property("tags.model_name", module_name)
# Load tokenizer and model from HuggingFace
config = GPT2Config.from_pretrained(variant)
config_dict = config.to_dict()
config_dict["return_dict"] = False
config_dict["use_cache"] = False
config = GPT2Config(**config_dict)
model = download_model(GPT2LMHeadModel.from_pretrained, variant, config=config)
# Wrapper to get around past key values
class Wrapper(torch.nn.Module):
def __init__(self, model):
super().__init__()
self.model = model
def forward(self, input_ids, attention_mask):
return self.model(input_ids, None, attention_mask)
input_ids = torch.cat(
[torch.randint(1, model.config.vocab_size, (1, 255)), torch.zeros(1, 1, dtype=torch.int64)], dim=-1
).to(torch.int64)
attn_mask = torch.ones(1, 256)
inputs = [input_ids, attn_mask]
framework_model = Wrapper(model)
# Forge compile framework model
compiled_model = forge.compile(framework_model, sample_inputs=inputs, module_name=module_name)
# Model Verification
> verify(inputs, framework_model, compiled_model)
forge/test/models/pytorch/text/gpt2/test_gpt2.py:55:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/verify/verify.py:302: in verify
co_out = compiled_model(*inputs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <forge.compiled_graph_state.CompiledModel object at 0x7ff7a7574dc0>
inputs = (tensor([[29133, 28000, 17958, 22849, 11636, 28204, 34532, 32312, 14762, 43444, 13158, 47523, 49381, 42088, 25607, 398...1., 1., 1., 1., 1.,
1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1., 1.]]))
inputs_and_parameters = [tensor([[29133, 28000, 17958, 22849, 11636, 28204, 34532, 32312, 14762, 43444, 13158, 47523, 49381, 42088, 25607, 398... [1.00000e-05],
[1.00000e-05],
[1.00000e-05],
[1.00000e-05]]]), tensor([0.12500]), ...]
def __call__(self, *inputs: AnyTensor) -> List[torch.Tensor]:
"""
Run inference on the compiled model.
Parameters
----------
inputs: [Tensor, ...]
Input tensors
Returns
-------
List[Tensor]
Output tensors
"""
self.inputs = [*to_pt_tensors(inputs)]
# After tensors are transformed to pt tensors, we have to cast them to dtypes that are actually supported by our hardware.
self.inputs = [cast_unsupported_torch_dtype(input_tensor) for input_tensor in self.inputs]
inputs_and_parameters = [
*self.inputs,
*self.fwd_compiled_graph_state.get_ordered_constant_tensors(),
*self.fwd_compiled_graph_state.get_ordered_parameter_tensors(),
]
assert all(
[isinstance(t, torch.Tensor) for t in inputs_and_parameters]
), "All inputs should be torch tensors by now."
if self.training() and isinstance(self.framework_module, PyTorchModule):
for name, param in self.framework_module.module.named_parameters():
if param.requires_grad:
our_tensor = self.fwd_compiled_graph_state.get_parameter_tensor(name)
# NOTE: for parameters that require gradients, we want to share the same tensor with the PyTorch
# module. This is because we want to be able to optimize the parameters both on the device
# (through our runtime) and via the torch optimizers. So this ensures that whichever side updates
# the parameter value, the other side can see the change.
#
# This could change in the future, but for now ensure that our premise is correct.
assert param is our_tensor
logger.info(
f"Running model {self.framework_module.get_name()} {self.fwd_compiled_graph_state.graph.get_name()} on device..."
)
> all_outputs = run_binary(self.compiled_binary, int(ProgramId.FORWARD), inputs_and_parameters)
E RuntimeError: Tensor 6 - data type mismatch: expected Float32, got UInt8
/opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/compiled_graph_state.py:266: RuntimeError
Check failure on line 90 in forge/test/models/pytorch/text/t5/test_t5.py
github-actions / TT-Forge-FE Tests
test_t5.test_t5_generation[t5-base]
ValueError: Data mismatch -> AutomaticValueChecker (compare_with_golden): framework_model=tensor([[[-18.88008, -10.41466, -14.89029, ..., -43.63989, -43.76201, -43.71423]]], grad_fn=<UnsafeViewBackward0>), compiled_model=tensor([[[-22.58375, -11.44749, -15.44133, ..., -44.65742, -44.40396, -44.39893]]])
Raw output
record_forge_property = <test.conftest.ForgePropertyStore object at 0x7ff632f2ff40>
variant = 't5-base'
@pytest.mark.nightly
@pytest.mark.parametrize("variant", variants)
def test_t5_generation(record_forge_property, variant):
if variant not in {"t5-small", "google/flan-t5-small", "t5-base", "t5-large"}:
pytest.skip(f"Skipping {variant} due to the current CI/CD pipeline limitations")
# Build Module Name
module_name = build_module_name(
framework=Framework.PYTORCH, model="t5", variant=variant, task=Task.TEXT_GENERATION, source=Source.HUGGINGFACE
)
# Record Forge Property
record_forge_property("tags.model_name", module_name)
# Load tokenizer and model from HuggingFace
# Variants: t5-small, t5-base, t5-large
config = download_model(T5Config.from_pretrained, variant)
config_dict = config.to_dict()
config_dict["return_dict"] = False
config_dict["use_cache"] = False
config = T5Config(**config_dict)
model = download_model(T5ForConditionalGeneration.from_pretrained, variant, config=config)
tokenizer = AutoTokenizer.from_pretrained(variant)
inputs = tokenizer(
"summarize: Researchers have extensively studied the benefits of having pets, "
"particularly dogs, on human health and well-being. Findings suggest that pet ownership "
"can lead to improved mental health, reduced stress levels, and even physical health benefits "
"such as lower blood pressure and increased physical activity levels due to regular walks.",
return_tensors="pt",
)
input_ids = inputs.input_ids
decoder_start_token_tensor = torch.tensor(model.generation_config.decoder_start_token_id, dtype=torch.long)
decoder_input_ids = torch.ones((1, 1), dtype=torch.long) * decoder_start_token_tensor
inputs = [input_ids, decoder_input_ids]
class Wrapper(torch.nn.Module):
def __init__(self, model):
super().__init__()
self.model = model
def forward(self, input_ids, decoder_input_ids):
inputs = {"input_ids": input_ids, "decoder_input_ids": decoder_input_ids}
output = self.model(**inputs)
return output
framework_model = Wrapper(model)
# Forge compile
compiled_model = forge.compile(framework_model, sample_inputs=inputs, module_name=module_name)
# Model Verification
> verify(inputs, framework_model, compiled_model)
forge/test/models/pytorch/text/t5/test_t5.py:90:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/verify/verify.py:333: in verify
verify_cfg.value_checker.check(fw, co)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <forge.verify.value_checkers.AutomaticValueChecker object at 0x7ff7bff2d5a0>
fw_out = tensor([[[-18.88008, -10.41466, -14.89029, ..., -43.63989, -43.76201, -43.71423]]], grad_fn=<UnsafeViewBackward0>)
co_out = tensor([[[-22.58375, -11.44749, -15.44133, ..., -44.65742, -44.40396, -44.39893]]])
def check(self, fw_out, co_out):
if not compare_with_golden(fw_out, co_out, self.pcc, self.rtol, self.atol, self.dissimilarity_threshold):
> raise ValueError(
f"Data mismatch -> AutomaticValueChecker (compare_with_golden): framework_model={fw_out}, compiled_model={co_out}"
)
E ValueError: Data mismatch -> AutomaticValueChecker (compare_with_golden): framework_model=tensor([[[-18.88008, -10.41466, -14.89029, ..., -43.63989, -43.76201, -43.71423]]], grad_fn=<UnsafeViewBackward0>), compiled_model=tensor([[[-22.58375, -11.44749, -15.44133, ..., -44.65742, -44.40396, -44.39893]]])
/opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/verify/value_checkers.py:38: ValueError
Check failure on line 57 in forge/test/models/pytorch/text/xglm/test_xglm.py
github-actions / TT-Forge-FE Tests
test_xglm.test_xglm_causal_lm[facebook/xglm-564M]
RuntimeError: TT_THROW @ /__w/tt-forge-fe/tt-forge-fe/third_party/tt-mlir/third_party/tt-metal/src/tt-metal/tt_metal/impl/kernels/kernel.cpp:242: tt::exception
info:
1283 unique+common runtime args targeting kernel reader_concat_stick_layout_interleaved_start_id on (x=0,y=0) are too large. Max allowable is 256
backtrace:
--- /opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/lib/libtt_metal.so(+0x143335) [0x7ff7d5017335]
--- tt::tt_metal::v0::Kernel::validate_runtime_args_size(unsigned long, unsigned long, tt::umd::xy_pair const&)
--- tt::tt_metal::v0::Kernel::set_runtime_args(tt::umd::xy_pair const&, tt::stl::Span<unsigned int const, 18446744073709551615ul>)
--- /opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/lib/libtt_metal.so(+0x340573) [0x7ff7d5214573]
--- tt::tt_metal::v0::SetRuntimeArgs(tt::tt_metal::v0::Program const&, unsigned int, std::variant<tt::umd::xy_pair, CoreRange, CoreRangeSet> const&, tt::stl::Span<unsigned int const, 18446744073709551615ul>)
--- ttnn::operations::data_movement::detail::concat_multi_core(std::vector<tt::tt_metal::Tensor, std::allocator<tt::tt_metal::Tensor> > const&, unsigned int, tt::tt_metal::Tensor const&)
--- /opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/lib/_ttnn.so(+0x60fe83) [0x7ff7c3719e83]
--- /opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/lib/_ttnn.so(+0x25c0fda) [0x7ff7c56cafda]
--- /opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/lib/_ttnn.so(+0x25c13e4) [0x7ff7c56cb3e4]
--- /opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/lib/_ttnn.so(_ZN4ttnn16device_operation6detail23launch_on_worker_threadIN2tt8tt_metal9operation23OldInfraDeviceOperationISt6vectorINS4_6TensorESaIS8_EEEENS3_3stl10StrongTypeIhNS_10QueueIdTagEEElNS5_15DeviceOperationISA_EENSB_13tensor_args_tESA_PNS4_2v07IDeviceEEEvT0_T1_RKT2_RKT3_RT4_RT5_+0x2ab) [0x7ff7c56ca72b]
--- /opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/lib/_ttnn.so(_ZN4ttnn16device_operation6detail23launch_on_single_deviceIN2tt8tt_metal9operation23OldInfraDeviceOperationISt6vectorINS4_6TensorESaIS8_EEEEEENT_21tensor_return_value_tENS3_3stl10StrongTypeIhNS_10QueueIdTagEEERKNSC_22operation_attributes_tERKNSC_13tensor_args_tE+0x83) [0x7ff7c56ca3e3]
--- /opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/lib/_ttnn.so(+0x25c02d7) [0x7ff7c56ca2d7]
--- tt::tt_metal::operation::OldInfraDeviceOperation<std::vector<tt::tt_metal::Tensor, std::allocator<tt::tt_metal::Tensor> > >::tensor_return_value_t ttnn::device_operation::detail::invoke<tt::tt_metal::operation::OldInfraDeviceOperation<std::vector<tt::tt_metal::Tensor, std::allocator<tt::tt_metal::Tensor> > > >(tt::stl::StrongType<unsigned char, ttnn::QueueIdTag>, tt::tt_metal::operation::OldInfraDeviceOperation<std::vector<tt::tt_metal::Tensor, std::allocator<tt::tt_metal::Tensor> > >::operation_attributes_t const&, tt::tt_metal::operation::OldInfraDeviceOperation<std::vector<tt::tt_metal::Tensor, std::allocator<tt::tt_metal::Tensor> > >::tensor_args_t const&)
--- /opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/lib/_ttnn.so(+0x25bf49f) [0x7ff7c56c949f]
--- /opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/lib/_ttnn.so(_ZN2tt8tt_metal9operation19run_with_autoformatEONS1_15DeviceOperationISt6vectorINS0_6TensorESaIS4_EEEERKS6_RKS3_IN4ttnn10operations12experimental11auto_format12FormatParamsESaISF_EERKS3_INS0_6LayoutESaISK_EERKS3_ISt8optionalIKS4_ESaISR_EERKS3_ISP_ISF_ESaISW_EERKS3_ISP_IS4_ESaIS11_EENS_3stl10StrongTypeIhNSB_10QueueIdTagEEE+0x503) [0x7ff7c56c1883]
--- /opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/lib/_ttnn.so(+0x60f0b5) [0x7ff7c37190b5]
--- /opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/lib/_ttnn.so(+0x25c6fe2) [0x7ff7c56d0fe2]
--- /opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/lib/_ttnn.so(+0x25c77cc) [0x7ff7c56d17cc]
--- void tt::tt_metal::operation::launch_op_func<std::vector<tt::tt_metal::Tensor, std::allocator<tt::tt_metal::Tensor> > >(std::function<std::vector<tt::tt_metal::Tensor, std::allocator<tt::tt_metal::Tensor> > (std::vector<tt::tt_metal::Tensor, std::allocator<tt::tt_metal::Tensor> > const&, std::vector<std::optional<tt::tt_metal::Tensor const>, std::allocator<std::optional<tt::tt_metal::Tensor const> > > const&, std::vector<std::optional<tt::tt_metal::Tensor>, std::allocator<std::optional<tt::tt_metal::Tensor> > > const&)> const&, std::vector<tt::tt_metal::Tensor, std::allocator<tt::tt_metal::Tensor> >, std::vector<tt::tt_metal::Tensor, std::allocator<tt::tt_metal::Tensor> >&, std::vector<std::optional<tt::tt_metal::Tensor const>, std::allocator<std::optional<tt::tt_metal::Tensor const> > >, std::vector<std::optional<tt::tt_metal::Tensor>, std::allocator<std::optional<tt::tt_metal::Tensor> > >, bool)
--- ttnn::operations::data_movement::concat_impl(std::vector<tt::tt_metal::Tensor, std::allocator<tt::tt_metal::Tensor> > const&, long, unsigned int, tt::tt_metal::MemoryConfig const&)
--- /opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/lib/_ttnn.so(+0x60947b) [0x7ff7c371347b]
--- /opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/lib/_ttnn.so(+0x5e8895) [0x7ff7c36f2895]
--- ttnn::operations::data_movement::ConcatOperation::invoke(tt::stl::StrongType<unsigned char, ttnn::QueueIdTag>, std::vector<tt::tt_metal::Tensor, std::allocator<tt::tt_metal::Tensor> > const&, int, std::optional<tt::tt_metal::MemoryConfig> const&, std::optional<tt::tt_metal::Tensor> const&, unsigned int)
--- /opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/lib/_ttnn.so(+0x577513) [0x7ff7c3681513]
--- /opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/lib/_ttnn.so(+0x577421) [0x7ff7c3681421]
--- /opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/lib/_ttnn.so(+0x57737c) [0x7ff7c368137c]
--- void tt::tt_metal::operation::launch_op_func<std::vector<tt::tt_metal::Tensor, std::allocator<tt::tt_metal::Tensor> > >(std::function<std::vector<tt::tt_metal::Tensor, std::allocator<tt::tt_metal::Tensor> > (std::vector<tt::tt_metal::Tensor, std::allocator<tt::tt_metal::Tensor> > const&, std::vector<std::optional<tt::tt_metal::Tensor const>, std::allocator<std::optional<tt::tt_metal::Tensor const> > > const&, std::vector<std::optional<tt::tt_metal::Tensor>, std::allocator<std::optional<tt::tt_metal::Tensor> > > const&)> const&, std::vector<tt::tt_metal::Tensor, std::allocator<tt::tt_metal::Tensor> >, std::vector<tt::tt_metal::Tensor, std::allocator<tt::tt_metal::Tensor> >&, std::vector<std::optional<tt::tt_metal::Tensor const>, std::allocator<std::optional<tt::tt_metal::Tensor const> > >, std::vector<std::optional<tt::tt_metal::Tensor>, std::allocator<std::optional<tt::tt_metal::Tensor> > >, bool)
--- /opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/lib/_ttnn.so(+0x57713c) [0x7ff7c368113c]
--- /opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/lib/_ttnn.so(+0x576bcb) [0x7ff7c3680bcb]
--- /opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/lib/_ttnn.so(+0x576749) [0x7ff7c3680749]
--- ttnn::operations::data_movement::ExecuteRepeatInterleave::invoke(tt::tt_metal::Tensor const&, unsigned int, int, std::optional<tt::tt_metal::MemoryConfig> const&)
--- /opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/lib/libTTMLIRRuntime.so(+0xe8614) [0x7ff7d5c16614]
--- /opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/lib/libTTMLIRRuntime.so(+0xe838a) [0x7ff7d5c1638a]
--- /opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/lib/libTTMLIRRuntime.so(+0xe82dc) [0x7ff7d5c162dc]
--- /opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/lib/_ttnn.so(+0x25c6fe2) [0x7ff7c56d0fe2]
--- /opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/lib/_ttnn.so(+0x25c77cc) [0x7ff7c56d17cc]
--- void tt::tt_metal::operation::launch_op_func<std::vector<tt::tt_metal::Tensor, std::allocator<tt::tt_metal::Tensor> > >(std::function<std::vector<tt::tt_metal::Tensor, std::allocator<tt::tt_metal::Tensor> > (std::vector<tt::tt_metal::Tensor, std::allocator<tt::tt_metal::Tensor> > const&, std::vector<std::optional<tt::tt_metal::Tensor const>, std::allocator<std::optional<tt::tt_metal::Tensor const> > > const&, std::vector<std::optional<tt::tt_metal::Tensor>, std::allocator<std::optional<tt::tt_metal::Tensor> > > const&)> const&, std::vector<tt::tt_metal::Tensor, std::allocator<tt::tt_metal::Tensor> >, std::vector<tt::tt_metal::Tensor, std::allocator<tt::tt_metal::Tensor> >&, std::vector<std::optional<tt::tt_metal::Tensor const>, std::allocator<std::optional<tt::tt_metal::Tensor const> > >, std::vector<std::optional<tt::tt_metal::Tensor>, std::allocator<std::optional<tt::tt_metal::Tensor> > >, bool)
--- /opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/lib/libTTMLIRRuntime.so(+0xe7fe3) [0x7ff7d5c15fe3]
--- /opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/lib/libTTMLIRRuntime.so(+0xe7b2c) [0x7ff7d5c15b2c]
--- /opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/lib/libTTMLIRRuntime.so(+0xe75b7) [0x7ff7d5c155b7]
--- tt::runtime::ttnn::operations::data_movement::run(tt::target::ttnn::RepeatInterleaveOp const*, tt::runtime::ttnn::ProgramContext&)
--- tt::runtime::ttnn::runProgram(tt::tt_metal::distributed::MeshDevice&, tt::runtime::Binary, unsigned int, std::vector<tt::tt_metal::Tensor*, std::allocator<tt::tt_metal::Tensor*> > const&)
--- tt::runtime::ttnn::submit(tt::runtime::Device, tt::runtime::Binary, unsigned int, std::vector<tt::runtime::Tensor, std::allocator<tt::runtime::Tensor> > const&)
--- tt::runtime::submit(tt::runtime::Device, tt::runtime::Binary, unsigned int, std::vector<tt::runtime::Tensor, std::allocator<tt::runtime::Tensor> > const&)
--- tt::run_binary(tt::runtime::Binary&, int, std::vector<at::Tensor, std::allocator<at::Tensor> > const&)
--- /opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/_C.so(+0x318900) [0x7ff7d6058900]
--- /opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/_C.so(+0x31884e) [0x7ff7d605884e]
--- /opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/_C.so(+0xe1e05) [0x7ff7d5e21e05]
--- /opt/ttforge-toolchain/venv/bin/python(+0x18ab32) [0x5612acea7b32]
--- /opt/ttforge-toolchain/venv/bin/python(_PyObject_MakeTpCall+0x25b) [0x5612ace9e39b]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x59c7) [0x5612ace97a97]
--- /opt/ttforge-toolchain/venv/bin/python(_PyObject_FastCallDictTstate+0xc4) [0x5612ace9d574]
--- /opt/ttforge-toolchain/venv/bin/python(_PyObject_Call_Prepend+0x5c) [0x5612aceb262c]
--- /opt/ttforge-toolchain/venv/bin/python(+0x29d464) [0x5612acfba464]
--- /opt/ttforge-toolchain/venv/bin/python(PyObject_Call+0xbb) [0x5612aceb610b]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2b60) [0x5612ace94c30]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x6c0) [0x5612ace92790]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
--- /opt/ttforge-toolchain/venv/bin/python(PyObject_Call+0x122) [0x5612aceb6172]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2b60) [0x5612ace94c30]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2b60) [0x5612ace94c30]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x18db) [0x5612ace939ab]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x5632) [0x5612ace97702]
--- /opt/ttforge-toolchain/venv/bin/python(+0x1984d1) [0x5612aceb54d1]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x5632) [0x5612ace97702]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyObject_FastCallDictTstate+0x16d) [0x5612ace9d61d]
--- /opt/ttforge-toolchain/venv/bin/python(_PyObject_Call_Prepend+0x5c) [0x5612aceb262c]
--- /opt/ttforge-toolchain/venv/bin/python(+0x29d464) [0x5612acfba464]
--- /opt/ttforge-toolchain/venv/bin/python(_PyObject_MakeTpCall+0x25b) [0x5612ace9e39b]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x68ce) [0x5612ace9899e]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x8af) [0x5612ace9297f]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2b60) [0x5612ace94c30]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x18db) [0x5612ace939ab]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x5632) [0x5612ace97702]
--- /opt/ttforge-toolchain/venv/bin/python(+0x1984d1) [0x5612aceb54d1]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x5632) [0x5612ace97702]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyObject_FastCallDictTstate+0x16d) [0x5612ace9d61d]
--- /opt/ttforge-toolchain/venv/bin/python(_PyObject_Call_Prepend+0x5c) [0x5612aceb262c]
--- /opt/ttforge-toolchain/venv/bin/python(+0x29d464) [0x5612acfba464]
--- /opt/ttforge-toolchain/venv/bin/python(PyObject_Call+0xbb) [0x5612aceb610b]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2b60) [0x5612ace94c30]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x6c0) [0x5612ace92790]
--- /opt/ttforge-toolchain/venv/bin/python(+0x1984d1) [0x5612aceb54d1]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x18db) [0x5612ace939ab]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2b60) [0x5612ace94c30]
Raw output
record_forge_property = <test.conftest.ForgePropertyStore object at 0x7ff86c77cbb0>
variant = 'facebook/xglm-564M'
@pytest.mark.nightly
@pytest.mark.parametrize("variant", variants, ids=variants)
def test_xglm_causal_lm(record_forge_property, variant):
if variant != "facebook/xglm-564M":
pytest.skip("Skipping due to the current CI/CD pipeline limitations")
# Build Module Name
module_name = build_module_name(
framework=Framework.PYTORCH, model="xglm", variant=variant, task=Task.CAUSAL_LM, source=Source.HUGGINGFACE
)
# Record Forge Property
record_forge_property("tags.model_name", module_name)
config = XGLMConfig.from_pretrained(variant)
config_dict = config.to_dict()
config_dict["return_dict"] = False
config_dict["use_cache"] = False
config = XGLMConfig(**config_dict)
framework_model = download_model(XGLMForCausalLM.from_pretrained, variant, config=config)
tokenizer = download_model(AutoTokenizer.from_pretrained, variant)
tokenizer.pad_token = tokenizer.eos_token
# Input sample
prefix_text = "My name is Thomas and my main"
input_tokens = tokenizer(
prefix_text,
max_length=256,
padding="max_length",
truncation=True,
return_tensors="pt",
)
inputs = [input_tokens["input_ids"], input_tokens["attention_mask"]]
# Forge compile framework model
compiled_model = forge.compile(framework_model, sample_inputs=inputs, module_name=module_name)
# Model Verification
> verify(inputs, framework_model, compiled_model)
forge/test/models/pytorch/text/xglm/test_xglm.py:57:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/verify/verify.py:302: in verify
co_out = compiled_model(*inputs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <forge.compiled_graph_state.CompiledModel object at 0x7ff85cb33eb0>
inputs = (tensor([[ 2, 1622, 4432, 67, 10128, 53, 363, 3270, 2, 2, 2, 2, 2, 2, 2, ...0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]]))
inputs_and_parameters = [tensor([[ 2, 1622, 4432, 67, 10128, 53, 363, 3270, 2, 2, 2, 2, 2, 2, 2, ... [0.00098],
[0.00098],
[0.00098],
[0.00098],
[0.00098],
[0.00098]]]), ...]
def __call__(self, *inputs: AnyTensor) -> List[torch.Tensor]:
"""
Run inference on the compiled model.
Parameters
----------
inputs: [Tensor, ...]
Input tensors
Returns
-------
List[Tensor]
Output tensors
"""
self.inputs = [*to_pt_tensors(inputs)]
# After tensors are transformed to pt tensors, we have to cast them to dtypes that are actually supported by our hardware.
self.inputs = [cast_unsupported_torch_dtype(input_tensor) for input_tensor in self.inputs]
inputs_and_parameters = [
*self.inputs,
*self.fwd_compiled_graph_state.get_ordered_constant_tensors(),
*self.fwd_compiled_graph_state.get_ordered_parameter_tensors(),
]
assert all(
[isinstance(t, torch.Tensor) for t in inputs_and_parameters]
), "All inputs should be torch tensors by now."
if self.training() and isinstance(self.framework_module, PyTorchModule):
for name, param in self.framework_module.module.named_parameters():
if param.requires_grad:
our_tensor = self.fwd_compiled_graph_state.get_parameter_tensor(name)
# NOTE: for parameters that require gradients, we want to share the same tensor with the PyTorch
# module. This is because we want to be able to optimize the parameters both on the device
# (through our runtime) and via the torch optimizers. So this ensures that whichever side updates
# the parameter value, the other side can see the change.
#
# This could change in the future, but for now ensure that our premise is correct.
assert param is our_tensor
logger.info(
f"Running model {self.framework_module.get_name()} {self.fwd_compiled_graph_state.graph.get_name()} on device..."
)
> all_outputs = run_binary(self.compiled_binary, int(ProgramId.FORWARD), inputs_and_parameters)
E RuntimeError: TT_THROW @ /__w/tt-forge-fe/tt-forge-fe/third_party/tt-mlir/third_party/tt-metal/src/tt-metal/tt_metal/impl/kernels/kernel.cpp:242: tt::exception
E info:
E 1283 unique+common runtime args targeting kernel reader_concat_stick_layout_interleaved_start_id on (x=0,y=0) are too large. Max allowable is 256
E backtrace:
E --- /opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/lib/libtt_metal.so(+0x143335) [0x7ff7d5017335]
E --- tt::tt_metal::v0::Kernel::validate_runtime_args_size(unsigned long, unsigned long, tt::umd::xy_pair const&)
E --- tt::tt_metal::v0::Kernel::set_runtime_args(tt::umd::xy_pair const&, tt::stl::Span<unsigned int const, 18446744073709551615ul>)
E --- /opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/lib/libtt_metal.so(+0x340573) [0x7ff7d5214573]
E --- tt::tt_metal::v0::SetRuntimeArgs(tt::tt_metal::v0::Program const&, unsigned int, std::variant<tt::umd::xy_pair, CoreRange, CoreRangeSet> const&, tt::stl::Span<unsigned int const, 18446744073709551615ul>)
E --- ttnn::operations::data_movement::detail::concat_multi_core(std::vector<tt::tt_metal::Tensor, std::allocator<tt::tt_metal::Tensor> > const&, unsigned int, tt::tt_metal::Tensor const&)
E --- /opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/lib/_ttnn.so(+0x60fe83) [0x7ff7c3719e83]
E --- /opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/lib/_ttnn.so(+0x25c0fda) [0x7ff7c56cafda]
E --- /opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/lib/_ttnn.so(+0x25c13e4) [0x7ff7c56cb3e4]
E --- /opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/lib/_ttnn.so(_ZN4ttnn16device_operation6detail23launch_on_worker_threadIN2tt8tt_metal9operation23OldInfraDeviceOperationISt6vectorINS4_6TensorESaIS8_EEEENS3_3stl10StrongTypeIhNS_10QueueIdTagEEElNS5_15DeviceOperationISA_EENSB_13tensor_args_tESA_PNS4_2v07IDeviceEEEvT0_T1_RKT2_RKT3_RT4_RT5_+0x2ab) [0x7ff7c56ca72b]
E --- /opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/lib/_ttnn.so(_ZN4ttnn16device_operation6detail23launch_on_single_deviceIN2tt8tt_metal9operation23OldInfraDeviceOperationISt6vectorINS4_6TensorESaIS8_EEEEEENT_21tensor_return_value_tENS3_3stl10StrongTypeIhNS_10QueueIdTagEEERKNSC_22operation_attributes_tERKNSC_13tensor_args_tE+0x83) [0x7ff7c56ca3e3]
E --- /opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/lib/_ttnn.so(+0x25c02d7) [0x7ff7c56ca2d7]
E --- tt::tt_metal::operation::OldInfraDeviceOperation<std::vector<tt::tt_metal::Tensor, std::allocator<tt::tt_metal::Tensor> > >::tensor_return_value_t ttnn::device_operation::detail::invoke<tt::tt_metal::operation::OldInfraDeviceOperation<std::vector<tt::tt_metal::Tensor, std::allocator<tt::tt_metal::Tensor> > > >(tt::stl::StrongType<unsigned char, ttnn::QueueIdTag>, tt::tt_metal::operation::OldInfraDeviceOperation<std::vector<tt::tt_metal::Tensor, std::allocator<tt::tt_metal::Tensor> > >::operation_attributes_t const&, tt::tt_metal::operation::OldInfraDeviceOperation<std::vector<tt::tt_metal::Tensor, std::allocator<tt::tt_metal::Tensor> > >::tensor_args_t const&)
E --- /opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/lib/_ttnn.so(+0x25bf49f) [0x7ff7c56c949f]
E --- /opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/lib/_ttnn.so(_ZN2tt8tt_metal9operation19run_with_autoformatEONS1_15DeviceOperationISt6vectorINS0_6TensorESaIS4_EEEERKS6_RKS3_IN4ttnn10operations12experimental11auto_format12FormatParamsESaISF_EERKS3_INS0_6LayoutESaISK_EERKS3_ISt8optionalIKS4_ESaISR_EERKS3_ISP_ISF_ESaISW_EERKS3_ISP_IS4_ESaIS11_EENS_3stl10StrongTypeIhNSB_10QueueIdTagEEE+0x503) [0x7ff7c56c1883]
E --- /opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/lib/_ttnn.so(+0x60f0b5) [0x7ff7c37190b5]
E --- /opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/lib/_ttnn.so(+0x25c6fe2) [0x7ff7c56d0fe2]
E --- /opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/lib/_ttnn.so(+0x25c77cc) [0x7ff7c56d17cc]
E --- void tt::tt_metal::operation::launch_op_func<std::vector<tt::tt_metal::Tensor, std::allocator<tt::tt_metal::Tensor> > >(std::function<std::vector<tt::tt_metal::Tensor, std::allocator<tt::tt_metal::Tensor> > (std::vector<tt::tt_metal::Tensor, std::allocator<tt::tt_metal::Tensor> > const&, std::vector<std::optional<tt::tt_metal::Tensor const>, std::allocator<std::optional<tt::tt_metal::Tensor const> > > const&, std::vector<std::optional<tt::tt_metal::Tensor>, std::allocator<std::optional<tt::tt_metal::Tensor> > > const&)> const&, std::vector<tt::tt_metal::Tensor, std::allocator<tt::tt_metal::Tensor> >, std::vector<tt::tt_metal::Tensor, std::allocator<tt::tt_metal::Tensor> >&, std::vector<std::optional<tt::tt_metal::Tensor const>, std::allocator<std::optional<tt::tt_metal::Tensor const> > >, std::vector<std::optional<tt::tt_metal::Tensor>, std::allocator<std::optional<tt::tt_metal::Tensor> > >, bool)
E --- ttnn::operations::data_movement::concat_impl(std::vector<tt::tt_metal::Tensor, std::allocator<tt::tt_metal::Tensor> > const&, long, unsigned int, tt::tt_metal::MemoryConfig const&)
E --- /opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/lib/_ttnn.so(+0x60947b) [0x7ff7c371347b]
E --- /opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/lib/_ttnn.so(+0x5e8895) [0x7ff7c36f2895]
E --- ttnn::operations::data_movement::ConcatOperation::invoke(tt::stl::StrongType<unsigned char, ttnn::QueueIdTag>, std::vector<tt::tt_metal::Tensor, std::allocator<tt::tt_metal::Tensor> > const&, int, std::optional<tt::tt_metal::MemoryConfig> const&, std::optional<tt::tt_metal::Tensor> const&, unsigned int)
E --- /opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/lib/_ttnn.so(+0x577513) [0x7ff7c3681513]
E --- /opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/lib/_ttnn.so(+0x577421) [0x7ff7c3681421]
E --- /opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/lib/_ttnn.so(+0x57737c) [0x7ff7c368137c]
E --- void tt::tt_metal::operation::launch_op_func<std::vector<tt::tt_metal::Tensor, std::allocator<tt::tt_metal::Tensor> > >(std::function<std::vector<tt::tt_metal::Tensor, std::allocator<tt::tt_metal::Tensor> > (std::vector<tt::tt_metal::Tensor, std::allocator<tt::tt_metal::Tensor> > const&, std::vector<std::optional<tt::tt_metal::Tensor const>, std::allocator<std::optional<tt::tt_metal::Tensor const> > > const&, std::vector<std::optional<tt::tt_metal::Tensor>, std::allocator<std::optional<tt::tt_metal::Tensor> > > const&)> const&, std::vector<tt::tt_metal::Tensor, std::allocator<tt::tt_metal::Tensor> >, std::vector<tt::tt_metal::Tensor, std::allocator<tt::tt_metal::Tensor> >&, std::vector<std::optional<tt::tt_metal::Tensor const>, std::allocator<std::optional<tt::tt_metal::Tensor const> > >, std::vector<std::optional<tt::tt_metal::Tensor>, std::allocator<std::optional<tt::tt_metal::Tensor> > >, bool)
E --- /opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/lib/_ttnn.so(+0x57713c) [0x7ff7c368113c]
E --- /opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/lib/_ttnn.so(+0x576bcb) [0x7ff7c3680bcb]
E --- /opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/lib/_ttnn.so(+0x576749) [0x7ff7c3680749]
E --- ttnn::operations::data_movement::ExecuteRepeatInterleave::invoke(tt::tt_metal::Tensor const&, unsigned int, int, std::optional<tt::tt_metal::MemoryConfig> const&)
E --- /opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/lib/libTTMLIRRuntime.so(+0xe8614) [0x7ff7d5c16614]
E --- /opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/lib/libTTMLIRRuntime.so(+0xe838a) [0x7ff7d5c1638a]
E --- /opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/lib/libTTMLIRRuntime.so(+0xe82dc) [0x7ff7d5c162dc]
E --- /opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/lib/_ttnn.so(+0x25c6fe2) [0x7ff7c56d0fe2]
E --- /opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/lib/_ttnn.so(+0x25c77cc) [0x7ff7c56d17cc]
E --- void tt::tt_metal::operation::launch_op_func<std::vector<tt::tt_metal::Tensor, std::allocator<tt::tt_metal::Tensor> > >(std::function<std::vector<tt::tt_metal::Tensor, std::allocator<tt::tt_metal::Tensor> > (std::vector<tt::tt_metal::Tensor, std::allocator<tt::tt_metal::Tensor> > const&, std::vector<std::optional<tt::tt_metal::Tensor const>, std::allocator<std::optional<tt::tt_metal::Tensor const> > > const&, std::vector<std::optional<tt::tt_metal::Tensor>, std::allocator<std::optional<tt::tt_metal::Tensor> > > const&)> const&, std::vector<tt::tt_metal::Tensor, std::allocator<tt::tt_metal::Tensor> >, std::vector<tt::tt_metal::Tensor, std::allocator<tt::tt_metal::Tensor> >&, std::vector<std::optional<tt::tt_metal::Tensor const>, std::allocator<std::optional<tt::tt_metal::Tensor const> > >, std::vector<std::optional<tt::tt_metal::Tensor>, std::allocator<std::optional<tt::tt_metal::Tensor> > >, bool)
E --- /opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/lib/libTTMLIRRuntime.so(+0xe7fe3) [0x7ff7d5c15fe3]
E --- /opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/lib/libTTMLIRRuntime.so(+0xe7b2c) [0x7ff7d5c15b2c]
E --- /opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/lib/libTTMLIRRuntime.so(+0xe75b7) [0x7ff7d5c155b7]
E --- tt::runtime::ttnn::operations::data_movement::run(tt::target::ttnn::RepeatInterleaveOp const*, tt::runtime::ttnn::ProgramContext&)
E --- tt::runtime::ttnn::runProgram(tt::tt_metal::distributed::MeshDevice&, tt::runtime::Binary, unsigned int, std::vector<tt::tt_metal::Tensor*, std::allocator<tt::tt_metal::Tensor*> > const&)
E --- tt::runtime::ttnn::submit(tt::runtime::Device, tt::runtime::Binary, unsigned int, std::vector<tt::runtime::Tensor, std::allocator<tt::runtime::Tensor> > const&)
E --- tt::runtime::submit(tt::runtime::Device, tt::runtime::Binary, unsigned int, std::vector<tt::runtime::Tensor, std::allocator<tt::runtime::Tensor> > const&)
E --- tt::run_binary(tt::runtime::Binary&, int, std::vector<at::Tensor, std::allocator<at::Tensor> > const&)
E --- /opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/_C.so(+0x318900) [0x7ff7d6058900]
E --- /opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/_C.so(+0x31884e) [0x7ff7d605884e]
E --- /opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/_C.so(+0xe1e05) [0x7ff7d5e21e05]
E --- /opt/ttforge-toolchain/venv/bin/python(+0x18ab32) [0x5612acea7b32]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_MakeTpCall+0x25b) [0x5612ace9e39b]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x59c7) [0x5612ace97a97]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_FastCallDictTstate+0xc4) [0x5612ace9d574]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_Call_Prepend+0x5c) [0x5612aceb262c]
E --- /opt/ttforge-toolchain/venv/bin/python(+0x29d464) [0x5612acfba464]
E --- /opt/ttforge-toolchain/venv/bin/python(PyObject_Call+0xbb) [0x5612aceb610b]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2b60) [0x5612ace94c30]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x6c0) [0x5612ace92790]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
E --- /opt/ttforge-toolchain/venv/bin/python(PyObject_Call+0x122) [0x5612aceb6172]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2b60) [0x5612ace94c30]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2b60) [0x5612ace94c30]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x18db) [0x5612ace939ab]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x5632) [0x5612ace97702]
E --- /opt/ttforge-toolchain/venv/bin/python(+0x1984d1) [0x5612aceb54d1]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x5632) [0x5612ace97702]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_FastCallDictTstate+0x16d) [0x5612ace9d61d]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_Call_Prepend+0x5c) [0x5612aceb262c]
E --- /opt/ttforge-toolchain/venv/bin/python(+0x29d464) [0x5612acfba464]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_MakeTpCall+0x25b) [0x5612ace9e39b]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x68ce) [0x5612ace9899e]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x8af) [0x5612ace9297f]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2b60) [0x5612ace94c30]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x18db) [0x5612ace939ab]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x5632) [0x5612ace97702]
E --- /opt/ttforge-toolchain/venv/bin/python(+0x1984d1) [0x5612aceb54d1]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x5632) [0x5612ace97702]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_FastCallDictTstate+0x16d) [0x5612ace9d61d]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_Call_Prepend+0x5c) [0x5612aceb262c]
E --- /opt/ttforge-toolchain/venv/bin/python(+0x29d464) [0x5612acfba464]
E --- /opt/ttforge-toolchain/venv/bin/python(PyObject_Call+0xbb) [0x5612aceb610b]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2b60) [0x5612ace94c30]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x6c0) [0x5612ace92790]
E --- /opt/ttforge-toolchain/venv/bin/python(+0x1984d1) [0x5612aceb54d1]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x18db) [0x5612ace939ab]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5612acea838c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2b60) [0x5612ace94c30]
/opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/compiled_graph_state.py:266: RuntimeError
Check failure on line 51 in forge/test/models/pytorch/vision/autoencoder/test_autoencoder.py
github-actions / TT-Forge-FE Tests
test_autoencoder.test_conv_ae_pytorch
RuntimeError: Found Unsupported operations while lowering from TTForge to TTIR in forward graph
Raw output
record_forge_property = <test.conftest.ForgePropertyStore object at 0x7ff85cb744c0>
@pytest.mark.nightly
def test_conv_ae_pytorch(record_forge_property):
# Build Module Name
module_name = build_module_name(
framework=Framework.PYTORCH, model="autoencoder", variant="conv", task=Task.IMAGE_ENCODING, source=Source.GITHUB
)
# Record Forge Property
record_forge_property("tags.model_name", module_name)
# Instantiate model
# NOTE: The model has not been pre-trained or fine-tuned.
# This is for demonstration purposes only.
framework_model = ConvAE()
# Define transform to normalize data
transform = transforms.Compose(
[
transforms.ToTensor(),
transforms.Normalize((0.1307,), (0.3081,)),
]
)
# Load sample from MNIST dataset
dataset = load_dataset("mnist")
sample = dataset["train"][0]["image"]
sample_tensor = transform(sample).unsqueeze(0)
inputs = [sample_tensor]
# Forge compile framework model
> compiled_model = forge.compile(framework_model, sample_inputs=inputs, module_name=module_name)
forge/test/models/pytorch/vision/autoencoder/test_autoencoder.py:51:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/compile.py:251: in compile_main
return forge_compile_from_context(compile_context)
/opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/compile.py:293: in forge_compile_from_context
next_stage = stage_to_func[current_stage](context)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
context = CompileContext(modules=[Module pt_autoencoder_conv_img_enc_github], graph_name='pt_autoencoder_conv_img_enc_github', c...cles_offset=0, forge_module=<forge._C.ForgeGraphModule object at 0x7ff86bd33870>, compiled_binary=None, attach_to=None)
def run_mlir_compiler(context: CompileContext) -> CompileDepth:
assert context.forge_module is not None
> context.compiled_binary = forge._C.run_mlir_compiler(context.forge_module)
E RuntimeError: Found Unsupported operations while lowering from TTForge to TTIR in forward graph
/opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/compile.py:986: RuntimeError
Check failure on line 59 in forge/test/models/pytorch/vision/deit/test_deit.py
github-actions / TT-Forge-FE Tests
test_deit.test_deit_imgcls_hf_pytorch[facebook/deit-base-patch16-224]
RuntimeError: Failed to run MLIR compiler pass pipeline.
Raw output
record_forge_property = <test.conftest.ForgePropertyStore object at 0x7ff85cb32800>
variant = 'facebook/deit-base-patch16-224'
@pytest.mark.nightly
@pytest.mark.parametrize("variant", variants, ids=variants)
def test_deit_imgcls_hf_pytorch(record_forge_property, variant):
if variant != "facebook/deit-base-patch16-224":
pytest.skip("Skipping due to the current CI/CD pipeline limitations")
# Build Module Name
module_name = build_module_name(
framework=Framework.PYTORCH,
model="deit",
variant=variant,
task=Task.IMAGE_CLASSIFICATION,
source=Source.HUGGINGFACE,
)
# Record Forge Property
record_forge_property("tags.model_name", module_name)
framework_model, inputs, _ = generate_model_deit_imgcls_hf_pytorch(
variant,
)
# Forge compile framework model
> compiled_model = forge.compile(framework_model, sample_inputs=inputs, module_name=module_name)
forge/test/models/pytorch/vision/deit/test_deit.py:59:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/compile.py:251: in compile_main
return forge_compile_from_context(compile_context)
/opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/compile.py:293: in forge_compile_from_context
next_stage = stage_to_func[current_stage](context)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
context = CompileContext(modules=[Module pt_deit_facebook_deit_base_patch16_224_img_cls_hf], graph_name='pt_deit_facebook_deit_b...cles_offset=0, forge_module=<forge._C.ForgeGraphModule object at 0x7ff85c657170>, compiled_binary=None, attach_to=None)
def run_mlir_compiler(context: CompileContext) -> CompileDepth:
assert context.forge_module is not None
> context.compiled_binary = forge._C.run_mlir_compiler(context.forge_module)
E RuntimeError: Failed to run MLIR compiler pass pipeline.
/opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/compile.py:986: RuntimeError
Check failure on line 71 in forge/test/models/pytorch/vision/densenet/test_densenet.py
github-actions / TT-Forge-FE Tests
test_densenet.test_densenet_121_pytorch[densenet121_hf_xray]
ValueError: Data mismatch -> AutomaticValueChecker (compare_with_golden): framework_model=tensor([[0.04869, 0.03288, 0.15531, 0.00566, 0.00114, 0.00461, 0.04744, 0.05742, 0.02110, 0.01312, 0.03669, 0.39452, 0.29256, 0.00085, 0.00119, 0.07292, 0.34686, 0.02730]], grad_fn=<SigmoidBackward0>), compiled_model=tensor([[0.02852, 0.02478, 0.21812, 0.00000, 0.00000, 0.00000, 0.05164, 0.04782, 0.01900, 0.02173, 0.02818, 0.42412, 0.28394, 0.00000, 0.00000, 0.04551, 0.45030, 0.02611]])
Raw output
record_forge_property = <test.conftest.ForgePropertyStore object at 0x7ff85cdd66b0>
variant = 'densenet121_hf_xray'
@pytest.mark.nightly
@pytest.mark.parametrize("variant", variants, ids=variants)
def test_densenet_121_pytorch(record_forge_property, variant):
if variant == "densenet121":
pytest.skip("Skipping due to the current CI/CD pipeline limitations")
# Build Module Name
module_name = build_module_name(
framework=Framework.PYTORCH,
model="densenet",
variant=variant,
source=Source.TORCHVISION,
task=Task.IMAGE_CLASSIFICATION,
)
# Record Forge Property
record_forge_property("tags.model_name", module_name)
# STEP 2: Create Forge module from PyTorch model
if variant == "densenet121":
framework_model = download_model(torch.hub.load, "pytorch/vision:v0.10.0", "densenet121", pretrained=True)
img_tensor = get_input_img()
else:
model_name = "densenet121-res224-all"
model = download_model(xrv.models.get_model, model_name)
framework_model = densenet_xray_wrapper(model)
img_tensor = get_input_img_hf_xray()
# STEP 3: Run inference on Tenstorrent device
inputs = [img_tensor]
# Forge compile framework model
compiled_model = forge.compile(framework_model, sample_inputs=inputs, module_name=module_name)
# Model Verification
> verify(inputs, framework_model, compiled_model)
forge/test/models/pytorch/vision/densenet/test_densenet.py:71:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/verify/verify.py:333: in verify
verify_cfg.value_checker.check(fw, co)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <forge.verify.value_checkers.AutomaticValueChecker object at 0x7ff7bff2d5a0>
fw_out = tensor([[0.04869, 0.03288, 0.15531, 0.00566, 0.00114, 0.00461, 0.04744, 0.05742, 0.02110, 0.01312, 0.03669, 0.39452, 0.29256, 0.00085, 0.00119, 0.07292, 0.34686, 0.02730]], grad_fn=<SigmoidBackward0>)
co_out = tensor([[0.02852, 0.02478, 0.21812, 0.00000, 0.00000, 0.00000, 0.05164, 0.04782, 0.01900, 0.02173, 0.02818, 0.42412, 0.28394, 0.00000, 0.00000, 0.04551, 0.45030, 0.02611]])
def check(self, fw_out, co_out):
if not compare_with_golden(fw_out, co_out, self.pcc, self.rtol, self.atol, self.dissimilarity_threshold):
> raise ValueError(
f"Data mismatch -> AutomaticValueChecker (compare_with_golden): framework_model={fw_out}, compiled_model={co_out}"
)
E ValueError: Data mismatch -> AutomaticValueChecker (compare_with_golden): framework_model=tensor([[0.04869, 0.03288, 0.15531, 0.00566, 0.00114, 0.00461, 0.04744, 0.05742, 0.02110, 0.01312, 0.03669, 0.39452, 0.29256, 0.00085, 0.00119, 0.07292, 0.34686, 0.02730]], grad_fn=<SigmoidBackward0>), compiled_model=tensor([[0.02852, 0.02478, 0.21812, 0.00000, 0.00000, 0.00000, 0.05164, 0.04782, 0.01900, 0.02173, 0.02818, 0.42412, 0.28394, 0.00000, 0.00000, 0.04551, 0.45030, 0.02611]])
/opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/verify/value_checkers.py:38: ValueError
Check failure on line 42 in forge/test/models/pytorch/vision/detr/test_detr.py
github-actions / TT-Forge-FE Tests
test_detr.test_detr_detection[facebook/detr-resnet-50]
AttributeError: <class 'tvm.ir.op.Op'> has no attribute name_hint
Raw output
record_forge_property = <test.conftest.ForgePropertyStore object at 0x7ff85c2e2c20>
variant = 'facebook/detr-resnet-50'
@pytest.mark.nightly
@pytest.mark.parametrize("variant", ["facebook/detr-resnet-50"])
def test_detr_detection(record_forge_property, variant):
# Build Module Name
module_name = build_module_name(
framework=Framework.PYTORCH,
model="detr",
variant=variant,
task=Task.OBJECT_DETECTION,
source=Source.HUGGINGFACE,
)
# Record Forge Property
record_forge_property("tags.model_name", module_name)
# Load the model
framework_model = DetrForObjectDetection.from_pretrained(variant)
# Preprocess the image for the model
image_url = "http://images.cocodataset.org/val2017/000000397133.jpg"
input_batch = preprocess_input_data(image_url)
inputs = [input_batch]
# Forge compile framework model
> compiled_model = forge.compile(framework_model, sample_inputs=inputs, module_name=module_name)
forge/test/models/pytorch/vision/detr/test_detr.py:42:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/compile.py:251: in compile_main
return forge_compile_from_context(compile_context)
/opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/compile.py:293: in forge_compile_from_context
next_stage = stage_to_func[current_stage](context)
/opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/compile.py:672: in generate_initial_graph
module, module_inputs = convert_to_forge_module(
/opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/compile.py:1033: in convert_to_forge_module
forge_module, dev_types, module_inputs = generate_forge_module(
/opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/tvm_to_python.py:2064: in generate_forge_module
module_writers, flattened_inputs = compile_tvm_to_python(
/opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/tvm_to_python.py:2153: in compile_tvm_to_python
json_graphs, flattened_pytorch_inputs, weights = load_tvm_graph(
/opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/tvm_calls/forge_compile.py:107: in load_tvm_graph
json_graphs, flattened_inputs = compile_tvm_graph(
/opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/tvm_calls/forge_compile.py:160: in compile_tvm_graph
json_graphs, inputs = compile_pytorch_for_forge(
/opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/tvm_calls/forge_compile.py:497: in compile_pytorch_for_forge
json_graphs = extract_graphs(
/opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/tvm_calls/forge_compile.py:257: in extract_graphs
if op.name_hint != cpu_pre_function:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = Op(zeros), name = 'name_hint'
def __getattr__(self, name):
# specially check handle since
# this is required for PackedFunc calls
if name == "handle":
raise AttributeError("handle is not set")
try:
return _ffi_node_api.NodeGetAttr(self, name)
except AttributeError:
> raise AttributeError(f"{type(self)} has no attribute {name}") from None
E AttributeError: <class 'tvm.ir.op.Op'> has no attribute name_hint
/opt/ttforge-toolchain/venv/lib/python3.10/site-packages/tvm/runtime/object.py:78: AttributeError
Check failure on line 41 in forge/test/models/onnx/vision/dla/test_dla.py
github-actions / TT-Forge-FE Tests
test_dla.test_dla_pytorch[dla34]
urllib.error.URLError: <urlopen error [Errno 110] Connection timed out>
Raw output
self = <urllib.request.HTTPHandler object at 0x7ff85c23b9d0>
http_class = <class 'http.client.HTTPConnection'>
req = <urllib.request.Request object at 0x7ff786509b70>, http_conn_args = {}
host = 'dl.yf.io', h = <http.client.HTTPConnection object at 0x7ff86bd0f160>
def do_open(self, http_class, req, **http_conn_args):
"""Return an HTTPResponse object for the request, using http_class.
http_class must implement the HTTPConnection API from http.client.
"""
host = req.host
if not host:
raise URLError('no host given')
# will parse host:port
h = http_class(host, timeout=req.timeout, **http_conn_args)
h.set_debuglevel(self._debuglevel)
headers = dict(req.unredirected_hdrs)
headers.update({k: v for k, v in req.headers.items()
if k not in headers})
# TODO(jhylton): Should this be redesigned to handle
# persistent connections?
# We want to make an HTTP/1.1 request, but the addinfourl
# class isn't prepared to deal with a persistent connection.
# It will try to read all remaining data from the socket,
# which will block while the server waits for the next request.
# So make sure the connection gets closed after the (only)
# request.
headers["Connection"] = "close"
headers = {name.title(): val for name, val in headers.items()}
if req._tunnel_host:
tunnel_headers = {}
proxy_auth_hdr = "Proxy-Authorization"
if proxy_auth_hdr in headers:
tunnel_headers[proxy_auth_hdr] = headers[proxy_auth_hdr]
# Proxy-Authorization should not be sent to origin
# server.
del headers[proxy_auth_hdr]
h.set_tunnel(req._tunnel_host, headers=tunnel_headers)
try:
try:
> h.request(req.get_method(), req.selector, req.data, headers,
encode_chunked=req.has_header('Transfer-encoding'))
/usr/lib/python3.10/urllib/request.py:1348:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <http.client.HTTPConnection object at 0x7ff86bd0f160>, method = 'GET'
url = '/dla/models/imagenet/dla34-ba72cf86.pth', body = None
headers = {'Connection': 'close', 'Host': 'dl.yf.io', 'User-Agent': 'torch.hub'}
def request(self, method, url, body=None, headers={}, *,
encode_chunked=False):
"""Send a complete request to the server."""
> self._send_request(method, url, body, headers, encode_chunked)
/usr/lib/python3.10/http/client.py:1283:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <http.client.HTTPConnection object at 0x7ff86bd0f160>, method = 'GET'
url = '/dla/models/imagenet/dla34-ba72cf86.pth', body = None
headers = {'Connection': 'close', 'Host': 'dl.yf.io', 'User-Agent': 'torch.hub'}
encode_chunked = False
def _send_request(self, method, url, body, headers, encode_chunked):
# Honor explicitly requested Host: and Accept-Encoding: headers.
header_names = frozenset(k.lower() for k in headers)
skips = {}
if 'host' in header_names:
skips['skip_host'] = 1
if 'accept-encoding' in header_names:
skips['skip_accept_encoding'] = 1
self.putrequest(method, url, **skips)
# chunked encoding will happen if HTTP/1.1 is used and either
# the caller passes encode_chunked=True or the following
# conditions hold:
# 1. content-length has not been explicitly set
# 2. the body is a file or iterable, but not a str or bytes-like
# 3. Transfer-Encoding has NOT been explicitly set by the caller
if 'content-length' not in header_names:
# only chunk body if not explicitly set for backwards
# compatibility, assuming the client code is already handling the
# chunking
if 'transfer-encoding' not in header_names:
# if content-length cannot be automatically determined, fall
# back to chunked encoding
encode_chunked = False
content_length = self._get_content_length(body, method)
if content_length is None:
if body is not None:
if self.debuglevel > 0:
print('Unable to determine size of %r' % body)
encode_chunked = True
self.putheader('Transfer-Encoding', 'chunked')
else:
self.putheader('Content-Length', str(content_length))
else:
encode_chunked = False
for hdr, value in headers.items():
self.putheader(hdr, value)
if isinstance(body, str):
# RFC 2616 Section 3.7.1 says that text default has a
# default charset of iso-8859-1.
body = _encode(body, 'body')
> self.endheaders(body, encode_chunked=encode_chunked)
/usr/lib/python3.10/http/client.py:1329:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <http.client.HTTPConnection object at 0x7ff86bd0f160>
message_body = None
def endheaders(self, message_body=None, *, encode_chunked=False):
"""Indicate that the last header line has been sent to the server.
This method sends the request to the server. The optional message_body
argument can be used to pass a message body associated with the
request.
"""
if self.__state == _CS_REQ_STARTED:
self.__state = _CS_REQ_SENT
else:
raise CannotSendHeader()
> self._send_output(message_body, encode_chunked=encode_chunked)
/usr/lib/python3.10/http/client.py:1278:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <http.client.HTTPConnection object at 0x7ff86bd0f160>
message_body = None, encode_chunked = False
def _send_output(self, message_body=None, encode_chunked=False):
"""Send the currently buffered request and clear the buffer.
Appends an extra \\r\\n to the buffer.
A message_body may be specified, to be appended to the request.
"""
self._buffer.extend((b"", b""))
msg = b"\r\n".join(self._buffer)
del self._buffer[:]
> self.send(msg)
/usr/lib/python3.10/http/client.py:1038:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <http.client.HTTPConnection object at 0x7ff86bd0f160>
data = b'GET /dla/models/imagenet/dla34-ba72cf86.pth HTTP/1.1\r\nAccept-Encoding: identity\r\nHost: dl.yf.io\r\nUser-Agent: torch.hub\r\nConnection: close\r\n\r\n'
def send(self, data):
"""Send `data' to the server.
``data`` can be a string object, a bytes object, an array object, a
file-like object that supports a .read() method, or an iterable object.
"""
if self.sock is None:
if self.auto_open:
> self.connect()
/usr/lib/python3.10/http/client.py:976:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <http.client.HTTPConnection object at 0x7ff86bd0f160>
def connect(self):
"""Connect to the host and port specified in __init__."""
sys.audit("http.client.connect", self, self.host, self.port)
> self.sock = self._create_connection(
(self.host,self.port), self.timeout, self.source_address)
/usr/lib/python3.10/http/client.py:942:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
address = ('dl.yf.io', 80), timeout = <object object at 0x7ff88985ce70>
source_address = None
def create_connection(address, timeout=_GLOBAL_DEFAULT_TIMEOUT,
source_address=None):
"""Connect to *address* and return the socket object.
Convenience function. Connect to *address* (a 2-tuple ``(host,
port)``) and return the socket object. Passing the optional
*timeout* parameter will set the timeout on the socket instance
before attempting to connect. If no *timeout* is supplied, the
global default timeout setting returned by :func:`getdefaulttimeout`
is used. If *source_address* is set it must be a tuple of (host, port)
for the socket to bind as a source address before making the connection.
A host of '' or port 0 tells the OS to use the default.
"""
host, port = address
err = None
for res in getaddrinfo(host, port, 0, SOCK_STREAM):
af, socktype, proto, canonname, sa = res
sock = None
try:
sock = socket(af, socktype, proto)
if timeout is not _GLOBAL_DEFAULT_TIMEOUT:
sock.settimeout(timeout)
if source_address:
sock.bind(source_address)
sock.connect(sa)
# Break explicitly a reference cycle
err = None
return sock
except error as _:
err = _
if sock is not None:
sock.close()
if err is not None:
try:
> raise err
/usr/lib/python3.10/socket.py:845:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
address = ('dl.yf.io', 80), timeout = <object object at 0x7ff88985ce70>
source_address = None
def create_connection(address, timeout=_GLOBAL_DEFAULT_TIMEOUT,
source_address=None):
"""Connect to *address* and return the socket object.
Convenience function. Connect to *address* (a 2-tuple ``(host,
port)``) and return the socket object. Passing the optional
*timeout* parameter will set the timeout on the socket instance
before attempting to connect. If no *timeout* is supplied, the
global default timeout setting returned by :func:`getdefaulttimeout`
is used. If *source_address* is set it must be a tuple of (host, port)
for the socket to bind as a source address before making the connection.
A host of '' or port 0 tells the OS to use the default.
"""
host, port = address
err = None
for res in getaddrinfo(host, port, 0, SOCK_STREAM):
af, socktype, proto, canonname, sa = res
sock = None
try:
sock = socket(af, socktype, proto)
if timeout is not _GLOBAL_DEFAULT_TIMEOUT:
sock.settimeout(timeout)
if source_address:
sock.bind(source_address)
> sock.connect(sa)
E TimeoutError: [Errno 110] Connection timed out
/usr/lib/python3.10/socket.py:833: TimeoutError
During handling of the above exception, another exception occurred:
record_forge_property = <test.conftest.ForgePropertyStore object at 0x7ff786508190>
variant = 'dla34'
@pytest.mark.nightly
@pytest.mark.parametrize("variant", variants)
def test_dla_pytorch(record_forge_property, variant):
if variant != "dla34":
pytest.skip("Skipping due to the current CI/CD pipeline limitations")
# Build Module Name
module_name = build_module_name(
framework=Framework.PYTORCH, model="dla", variant=variant, task=Task.VISUAL_BACKBONE, source=Source.TORCHVISION
)
# Record Forge Property
record_forge_property("tags.model_name", module_name)
# Load the model and prepare input data
> framework_model, inputs = load_dla_model(variant)
forge/test/models/pytorch/vision/dla/test_dla.py:41:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
forge/test/models/pytorch/vision/dla/utils/utils.py:34: in load_dla_model
framework_model = func(pretrained="imagenet")
forge/test/models/pytorch/vision/dla/utils/dla_model.py:473: in dla34
model.load_pretrained_model(pretrained, "dla34")
forge/test/models/pytorch/vision/dla/utils/dla_model.py:466: in load_pretrained_model
self.load_state_dict(model_zoo.load_url(model_url))
/opt/ttforge-toolchain/venv/lib/python3.10/site-packages/torch/hub.py:766: in load_state_dict_from_url
download_url_to_file(url, cached_file, hash_prefix, progress=progress)
/opt/ttforge-toolchain/venv/lib/python3.10/site-packages/torch/hub.py:620: in download_url_to_file
u = urlopen(req)
/usr/lib/python3.10/urllib/request.py:216: in urlopen
return opener.open(url, data, timeout)
/usr/lib/python3.10/urllib/request.py:519: in open
response = self._open(req, data)
/usr/lib/python3.10/urllib/request.py:536: in _open
result = self._call_chain(self.handle_open, protocol, protocol +
/usr/lib/python3.10/urllib/request.py:496: in _call_chain
result = func(*args)
/usr/lib/python3.10/urllib/request.py:1377: in http_open
return self.do_open(http.client.HTTPConnection, req)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <urllib.request.HTTPHandler object at 0x7ff85c23b9d0>
http_class = <class 'http.client.HTTPConnection'>
req = <urllib.request.Request object at 0x7ff786509b70>, http_conn_args = {}
host = 'dl.yf.io', h = <http.client.HTTPConnection object at 0x7ff86bd0f160>
def do_open(self, http_class, req, **http_conn_args):
"""Return an HTTPResponse object for the request, using http_class.
http_class must implement the HTTPConnection API from http.client.
"""
host = req.host
if not host:
raise URLError('no host given')
# will parse host:port
h = http_class(host, timeout=req.timeout, **http_conn_args)
h.set_debuglevel(self._debuglevel)
headers = dict(req.unredirected_hdrs)
headers.update({k: v for k, v in req.headers.items()
if k not in headers})
# TODO(jhylton): Should this be redesigned to handle
# persistent connections?
# We want to make an HTTP/1.1 request, but the addinfourl
# class isn't prepared to deal with a persistent connection.
# It will try to read all remaining data from the socket,
# which will block while the server waits for the next request.
# So make sure the connection gets closed after the (only)
# request.
headers["Connection"] = "close"
headers = {name.title(): val for name, val in headers.items()}
if req._tunnel_host:
tunnel_headers = {}
proxy_auth_hdr = "Proxy-Authorization"
if proxy_auth_hdr in headers:
tunnel_headers[proxy_auth_hdr] = headers[proxy_auth_hdr]
# Proxy-Authorization should not be sent to origin
# server.
del headers[proxy_auth_hdr]
h.set_tunnel(req._tunnel_host, headers=tunnel_headers)
try:
try:
h.request(req.get_method(), req.selector, req.data, headers,
encode_chunked=req.has_header('Transfer-encoding'))
except OSError as err: # timeout error
> raise URLError(err)
E urllib.error.URLError: <urlopen error [Errno 110] Connection timed out>
/usr/lib/python3.10/urllib/request.py:1351: URLError
Check failure on line 68 in forge/test/models/pytorch/vision/mlp_mixer/test_mlp_mixer.py
github-actions / TT-Forge-FE Tests
test_mlp_mixer.test_mlp_mixer_timm_pytorch[mixer_b16_224]
RuntimeError: Failed to run MLIR compiler pass pipeline.
Raw output
record_forge_property = <test.conftest.ForgePropertyStore object at 0x7ff778a8f700>
variant = 'mixer_b16_224'
@pytest.mark.nightly
@pytest.mark.parametrize("variant", varaints, ids=varaints)
def test_mlp_mixer_timm_pytorch(record_forge_property, variant):
if variant != "mixer_b16_224":
pytest.skip("Skipping due to the current CI/CD pipeline limitations")
# Build Module Name
module_name = build_module_name(
framework=Framework.PYTORCH,
model="mlp_mixer",
variant=variant,
source=Source.TIMM,
task=Task.IMAGE_CLASSIFICATION,
)
# Record Forge Property
record_forge_property("tags.model_name", module_name)
framework_model = download_model(timm.create_model, variant, pretrained=True)
config = resolve_data_config({}, model=framework_model)
transform = create_transform(**config)
try:
url = "https://images.rawpixel.com/image_1300/cHJpdmF0ZS9sci9pbWFnZXMvd2Vic2l0ZS8yMDIyLTA1L3BkMTA2LTA0Ny1jaGltXzEuanBn.jpg"
image = Image.open(requests.get(url, stream=True).raw).convert("RGB")
except:
logger.warning(
"Failed to download the image file, replacing input with random tensor. Please check if the URL is up to date"
)
image = torch.rand(1, 3, 256, 256)
pixel_values = transform(image).unsqueeze(0)
inputs = [pixel_values]
# Forge compile framework model
> compiled_model = forge.compile(framework_model, sample_inputs=inputs, module_name=module_name)
forge/test/models/pytorch/vision/mlp_mixer/test_mlp_mixer.py:68:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/compile.py:251: in compile_main
return forge_compile_from_context(compile_context)
/opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/compile.py:293: in forge_compile_from_context
next_stage = stage_to_func[current_stage](context)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
context = CompileContext(modules=[Module pt_mlp_mixer_mixer_b16_224_img_cls_timm], graph_name='pt_mlp_mixer_mixer_b16_224_img_cl...cles_offset=0, forge_module=<forge._C.ForgeGraphModule object at 0x7ff85cb47170>, compiled_binary=None, attach_to=None)
def run_mlir_compiler(context: CompileContext) -> CompileDepth:
assert context.forge_module is not None
> context.compiled_binary = forge._C.run_mlir_compiler(context.forge_module)
E RuntimeError: Failed to run MLIR compiler pass pipeline.
/opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/compile.py:986: RuntimeError
Check failure on line 41 in forge/test/models/pytorch/vision/monodle/test_monodle.py
github-actions / TT-Forge-FE Tests
test_monodle.test_monodle_pytorch
urllib.error.URLError: <urlopen error [Errno 110] Connection timed out>
Raw output
self = <urllib.request.HTTPHandler object at 0x7ff85c23b9d0>
http_class = <class 'http.client.HTTPConnection'>
req = <urllib.request.Request object at 0x7ff778c1d8a0>, http_conn_args = {}
host = 'dl.yf.io', h = <http.client.HTTPConnection object at 0x7ff778c1d1b0>
def do_open(self, http_class, req, **http_conn_args):
"""Return an HTTPResponse object for the request, using http_class.
http_class must implement the HTTPConnection API from http.client.
"""
host = req.host
if not host:
raise URLError('no host given')
# will parse host:port
h = http_class(host, timeout=req.timeout, **http_conn_args)
h.set_debuglevel(self._debuglevel)
headers = dict(req.unredirected_hdrs)
headers.update({k: v for k, v in req.headers.items()
if k not in headers})
# TODO(jhylton): Should this be redesigned to handle
# persistent connections?
# We want to make an HTTP/1.1 request, but the addinfourl
# class isn't prepared to deal with a persistent connection.
# It will try to read all remaining data from the socket,
# which will block while the server waits for the next request.
# So make sure the connection gets closed after the (only)
# request.
headers["Connection"] = "close"
headers = {name.title(): val for name, val in headers.items()}
if req._tunnel_host:
tunnel_headers = {}
proxy_auth_hdr = "Proxy-Authorization"
if proxy_auth_hdr in headers:
tunnel_headers[proxy_auth_hdr] = headers[proxy_auth_hdr]
# Proxy-Authorization should not be sent to origin
# server.
del headers[proxy_auth_hdr]
h.set_tunnel(req._tunnel_host, headers=tunnel_headers)
try:
try:
> h.request(req.get_method(), req.selector, req.data, headers,
encode_chunked=req.has_header('Transfer-encoding'))
/usr/lib/python3.10/urllib/request.py:1348:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <http.client.HTTPConnection object at 0x7ff778c1d1b0>, method = 'GET'
url = '/dla/models/imagenet/dla34-ba72cf86.pth', body = None
headers = {'Connection': 'close', 'Host': 'dl.yf.io', 'User-Agent': 'torch.hub'}
def request(self, method, url, body=None, headers={}, *,
encode_chunked=False):
"""Send a complete request to the server."""
> self._send_request(method, url, body, headers, encode_chunked)
/usr/lib/python3.10/http/client.py:1283:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <http.client.HTTPConnection object at 0x7ff778c1d1b0>, method = 'GET'
url = '/dla/models/imagenet/dla34-ba72cf86.pth', body = None
headers = {'Connection': 'close', 'Host': 'dl.yf.io', 'User-Agent': 'torch.hub'}
encode_chunked = False
def _send_request(self, method, url, body, headers, encode_chunked):
# Honor explicitly requested Host: and Accept-Encoding: headers.
header_names = frozenset(k.lower() for k in headers)
skips = {}
if 'host' in header_names:
skips['skip_host'] = 1
if 'accept-encoding' in header_names:
skips['skip_accept_encoding'] = 1
self.putrequest(method, url, **skips)
# chunked encoding will happen if HTTP/1.1 is used and either
# the caller passes encode_chunked=True or the following
# conditions hold:
# 1. content-length has not been explicitly set
# 2. the body is a file or iterable, but not a str or bytes-like
# 3. Transfer-Encoding has NOT been explicitly set by the caller
if 'content-length' not in header_names:
# only chunk body if not explicitly set for backwards
# compatibility, assuming the client code is already handling the
# chunking
if 'transfer-encoding' not in header_names:
# if content-length cannot be automatically determined, fall
# back to chunked encoding
encode_chunked = False
content_length = self._get_content_length(body, method)
if content_length is None:
if body is not None:
if self.debuglevel > 0:
print('Unable to determine size of %r' % body)
encode_chunked = True
self.putheader('Transfer-Encoding', 'chunked')
else:
self.putheader('Content-Length', str(content_length))
else:
encode_chunked = False
for hdr, value in headers.items():
self.putheader(hdr, value)
if isinstance(body, str):
# RFC 2616 Section 3.7.1 says that text default has a
# default charset of iso-8859-1.
body = _encode(body, 'body')
> self.endheaders(body, encode_chunked=encode_chunked)
/usr/lib/python3.10/http/client.py:1329:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <http.client.HTTPConnection object at 0x7ff778c1d1b0>
message_body = None
def endheaders(self, message_body=None, *, encode_chunked=False):
"""Indicate that the last header line has been sent to the server.
This method sends the request to the server. The optional message_body
argument can be used to pass a message body associated with the
request.
"""
if self.__state == _CS_REQ_STARTED:
self.__state = _CS_REQ_SENT
else:
raise CannotSendHeader()
> self._send_output(message_body, encode_chunked=encode_chunked)
/usr/lib/python3.10/http/client.py:1278:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <http.client.HTTPConnection object at 0x7ff778c1d1b0>
message_body = None, encode_chunked = False
def _send_output(self, message_body=None, encode_chunked=False):
"""Send the currently buffered request and clear the buffer.
Appends an extra \\r\\n to the buffer.
A message_body may be specified, to be appended to the request.
"""
self._buffer.extend((b"", b""))
msg = b"\r\n".join(self._buffer)
del self._buffer[:]
> self.send(msg)
/usr/lib/python3.10/http/client.py:1038:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <http.client.HTTPConnection object at 0x7ff778c1d1b0>
data = b'GET /dla/models/imagenet/dla34-ba72cf86.pth HTTP/1.1\r\nAccept-Encoding: identity\r\nHost: dl.yf.io\r\nUser-Agent: torch.hub\r\nConnection: close\r\n\r\n'
def send(self, data):
"""Send `data' to the server.
``data`` can be a string object, a bytes object, an array object, a
file-like object that supports a .read() method, or an iterable object.
"""
if self.sock is None:
if self.auto_open:
> self.connect()
/usr/lib/python3.10/http/client.py:976:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <http.client.HTTPConnection object at 0x7ff778c1d1b0>
def connect(self):
"""Connect to the host and port specified in __init__."""
sys.audit("http.client.connect", self, self.host, self.port)
> self.sock = self._create_connection(
(self.host,self.port), self.timeout, self.source_address)
/usr/lib/python3.10/http/client.py:942:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
address = ('dl.yf.io', 80), timeout = <object object at 0x7ff88985ce70>
source_address = None
def create_connection(address, timeout=_GLOBAL_DEFAULT_TIMEOUT,
source_address=None):
"""Connect to *address* and return the socket object.
Convenience function. Connect to *address* (a 2-tuple ``(host,
port)``) and return the socket object. Passing the optional
*timeout* parameter will set the timeout on the socket instance
before attempting to connect. If no *timeout* is supplied, the
global default timeout setting returned by :func:`getdefaulttimeout`
is used. If *source_address* is set it must be a tuple of (host, port)
for the socket to bind as a source address before making the connection.
A host of '' or port 0 tells the OS to use the default.
"""
host, port = address
err = None
for res in getaddrinfo(host, port, 0, SOCK_STREAM):
af, socktype, proto, canonname, sa = res
sock = None
try:
sock = socket(af, socktype, proto)
if timeout is not _GLOBAL_DEFAULT_TIMEOUT:
sock.settimeout(timeout)
if source_address:
sock.bind(source_address)
sock.connect(sa)
# Break explicitly a reference cycle
err = None
return sock
except error as _:
err = _
if sock is not None:
sock.close()
if err is not None:
try:
> raise err
/usr/lib/python3.10/socket.py:845:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
address = ('dl.yf.io', 80), timeout = <object object at 0x7ff88985ce70>
source_address = None
def create_connection(address, timeout=_GLOBAL_DEFAULT_TIMEOUT,
source_address=None):
"""Connect to *address* and return the socket object.
Convenience function. Connect to *address* (a 2-tuple ``(host,
port)``) and return the socket object. Passing the optional
*timeout* parameter will set the timeout on the socket instance
before attempting to connect. If no *timeout* is supplied, the
global default timeout setting returned by :func:`getdefaulttimeout`
is used. If *source_address* is set it must be a tuple of (host, port)
for the socket to bind as a source address before making the connection.
A host of '' or port 0 tells the OS to use the default.
"""
host, port = address
err = None
for res in getaddrinfo(host, port, 0, SOCK_STREAM):
af, socktype, proto, canonname, sa = res
sock = None
try:
sock = socket(af, socktype, proto)
if timeout is not _GLOBAL_DEFAULT_TIMEOUT:
sock.settimeout(timeout)
if source_address:
sock.bind(source_address)
> sock.connect(sa)
E TimeoutError: [Errno 110] Connection timed out
/usr/lib/python3.10/socket.py:833: TimeoutError
During handling of the above exception, another exception occurred:
record_forge_property = <test.conftest.ForgePropertyStore object at 0x7ff778c1ca90>
@pytest.mark.nightly
def test_monodle_pytorch(record_forge_property):
# Build Module Name
module_name = build_module_name(
framework=Framework.PYTORCH, model="monodle", source=Source.TORCHVISION, task=Task.OBJECT_DETECTION
)
# Record Forge Property
record_forge_property("tags.model_name", module_name)
# Load data sample
url = "https://images.rawpixel.com/image_1300/cHJpdmF0ZS9sci9pbWFnZXMvd2Vic2l0ZS8yMDIyLTA1L3BkMTA2LTA0Ny1jaGltXzEuanBn.jpg"
image = Image.open(requests.get(url, stream=True).raw)
# Preprocessing
transform = transforms.Compose(
[
transforms.Resize(256),
transforms.CenterCrop(224),
transforms.ToTensor(),
transforms.Normalize(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225]),
]
)
img_tensor = transform(image).unsqueeze(0)
> framework_model = CenterNet3D(backbone="dla34")
forge/test/models/pytorch/vision/monodle/test_monodle.py:41:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
forge/test/models/pytorch/vision/monodle/utils/model.py:483: in __init__
self.backbone = dla34(pretrained=True, return_levels=True)
forge/test/models/pytorch/vision/monodle/utils/model.py:457: in dla34
model.load_pretrained_model(data="imagenet", name="dla34", hash="ba72cf86")
forge/test/models/pytorch/vision/monodle/utils/model.py:439: in load_pretrained_model
model_weights = model_zoo.load_url(model_url)
/opt/ttforge-toolchain/venv/lib/python3.10/site-packages/torch/hub.py:766: in load_state_dict_from_url
download_url_to_file(url, cached_file, hash_prefix, progress=progress)
/opt/ttforge-toolchain/venv/lib/python3.10/site-packages/torch/hub.py:620: in download_url_to_file
u = urlopen(req)
/usr/lib/python3.10/urllib/request.py:216: in urlopen
return opener.open(url, data, timeout)
/usr/lib/python3.10/urllib/request.py:519: in open
response = self._open(req, data)
/usr/lib/python3.10/urllib/request.py:536: in _open
result = self._call_chain(self.handle_open, protocol, protocol +
/usr/lib/python3.10/urllib/request.py:496: in _call_chain
result = func(*args)
/usr/lib/python3.10/urllib/request.py:1377: in http_open
return self.do_open(http.client.HTTPConnection, req)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <urllib.request.HTTPHandler object at 0x7ff85c23b9d0>
http_class = <class 'http.client.HTTPConnection'>
req = <urllib.request.Request object at 0x7ff778c1d8a0>, http_conn_args = {}
host = 'dl.yf.io', h = <http.client.HTTPConnection object at 0x7ff778c1d1b0>
def do_open(self, http_class, req, **http_conn_args):
"""Return an HTTPResponse object for the request, using http_class.
http_class must implement the HTTPConnection API from http.client.
"""
host = req.host
if not host:
raise URLError('no host given')
# will parse host:port
h = http_class(host, timeout=req.timeout, **http_conn_args)
h.set_debuglevel(self._debuglevel)
headers = dict(req.unredirected_hdrs)
headers.update({k: v for k, v in req.headers.items()
if k not in headers})
# TODO(jhylton): Should this be redesigned to handle
# persistent connections?
# We want to make an HTTP/1.1 request, but the addinfourl
# class isn't prepared to deal with a persistent connection.
# It will try to read all remaining data from the socket,
# which will block while the server waits for the next request.
# So make sure the connection gets closed after the (only)
# request.
headers["Connection"] = "close"
headers = {name.title(): val for name, val in headers.items()}
if req._tunnel_host:
tunnel_headers = {}
proxy_auth_hdr = "Proxy-Authorization"
if proxy_auth_hdr in headers:
tunnel_headers[proxy_auth_hdr] = headers[proxy_auth_hdr]
# Proxy-Authorization should not be sent to origin
# server.
del headers[proxy_auth_hdr]
h.set_tunnel(req._tunnel_host, headers=tunnel_headers)
try:
try:
h.request(req.get_method(), req.selector, req.data, headers,
encode_chunked=req.has_header('Transfer-encoding'))
except OSError as err: # timeout error
> raise URLError(err)
E urllib.error.URLError: <urlopen error [Errno 110] Connection timed out>
/usr/lib/python3.10/urllib/request.py:1351: URLError
Check failure on line 93 in forge/test/models/pytorch/vision/rcnn/test_rcnn.py
github-actions / TT-Forge-FE Tests
test_rcnn.test_rcnn_pytorch
RuntimeError: Failed to run MLIR compiler pass pipeline.
Raw output
record_forge_property = <test.conftest.ForgePropertyStore object at 0x7ff7778a4a90>
@pytest.mark.nightly
def test_rcnn_pytorch(record_forge_property):
# Build Module Name
module_name = build_module_name(
framework=Framework.PYTORCH, model="rcnn", source=Source.TORCHVISION, task=Task.OBJECT_DETECTION
)
# Record Forge Property
record_forge_property("tags.model_name", module_name)
# Load Alexnet Model
framework_model = torchvision.models.alexnet(pretrained=True)
num_classes = 2
num_features = framework_model.classifier[6].in_features
# Create class specific linear SVMs [Refer Section 2 in paper]
svm_layer = nn.Linear(num_features, num_classes)
# Replacing the Alexnet's ImageNet specific 1000-way classification layer with a randomly initialized (N + 1)-way classification layer(where N is the number of object classes, plus 1 for background)
# [Refer Section 2.3.Domain-specific fine-tuning in Paper]
init.normal_(svm_layer.weight, mean=0, std=0.01)
init.constant_(svm_layer.bias, 0)
framework_model.classifier[6] = svm_layer
framework_model.eval()
# Cancel gradient tracking
for param in framework_model.parameters():
param.requires_grad = False
# Image
img = cv2.imread("forge/test/models/files/samples/images/car.jpg")
transform = transforms.Compose(
[
transforms.ToPILImage(),
transforms.Resize((227, 227)),
transforms.RandomHorizontalFlip(),
transforms.ToTensor(),
transforms.Normalize((0.5, 0.5, 0.5), (0.5, 0.5, 0.5)),
]
)
# Selective search - A separate tool for generating proposals(potential regions that might contain objects) which can be fed to actual model
# As it is a pre-processing step,it is implemented on cpu
gs = cv2.ximgproc.segmentation.createSelectiveSearchSegmentation()
gs.setBaseImage(img)
gs.switchToSelectiveSearchFast()
rects = gs.process()
rects[:, 2] += rects[:, 0]
rects[:, 3] += rects[:, 1]
print("Suggested number of proposals: %d" % len(rects))
# Proposals generated by selective search were fed to a model in a loop manner to compute features.
# [Refer line No.151 in https://github.com/object-detection-algorithm/R-CNN/blob/master/py/car_detector.py]
for idx, rect in enumerate(rects):
xmin, ymin, xmax, ymax = rect
rect_img = img[ymin:ymax, xmin:xmax]
rect_transform = transform(rect_img)
inputs = [rect_transform.unsqueeze(0)]
# Build Module Name
module_name = build_module_name(
framework=Framework.PYTORCH,
model="rcnn",
suffix=f"rect_{idx}",
source=Source.TORCHVISION,
task=Task.OBJECT_DETECTION,
)
# Forge compile framework model
> compiled_model = forge.compile(framework_model, sample_inputs=inputs, module_name=module_name)
forge/test/models/pytorch/vision/rcnn/test_rcnn.py:93:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/compile.py:251: in compile_main
return forge_compile_from_context(compile_context)
/opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/compile.py:293: in forge_compile_from_context
next_stage = stage_to_func[current_stage](context)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
context = CompileContext(modules=[Module pt_rcnn_base_obj_det_torchvision_rect_0], graph_name='pt_rcnn_base_obj_det_torchvision_...cles_offset=0, forge_module=<forge._C.ForgeGraphModule object at 0x7ff778d14ab0>, compiled_binary=None, attach_to=None)
def run_mlir_compiler(context: CompileContext) -> CompileDepth:
assert context.forge_module is not None
> context.compiled_binary = forge._C.run_mlir_compiler(context.forge_module)
E RuntimeError: Failed to run MLIR compiler pass pipeline.
/opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/compile.py:986: RuntimeError
Check failure on line 61 in forge/test/models/pytorch/vision/segformer/test_segformer.py
github-actions / TT-Forge-FE Tests
test_segformer.test_segformer_image_classification_pytorch[nvidia/mit-b0]
RuntimeError: Failed to run MLIR compiler pass pipeline.
Raw output
record_forge_property = <test.conftest.ForgePropertyStore object at 0x7ff6e3f55a80>
variant = 'nvidia/mit-b0'
@pytest.mark.nightly
@pytest.mark.parametrize("variant", variants_img_classification)
def test_segformer_image_classification_pytorch(record_forge_property, variant):
if variant != "nvidia/mit-b0":
pytest.skip("Skipping due to the current CI/CD pipeline limitations")
# Build Module Name
module_name = build_module_name(
framework=Framework.PYTORCH,
model="segformer",
variant=variant,
task=Task.IMAGE_CLASSIFICATION,
source=Source.HUGGINGFACE,
)
# Record Forge Property
record_forge_property("tags.model_name", module_name)
# Set model configurations
config = SegformerConfig.from_pretrained(variant)
config_dict = config.to_dict()
config_dict["return_dict"] = False
config = SegformerConfig(**config_dict)
# Load the model from HuggingFace
framework_model = SegformerForImageClassification.from_pretrained(variant, config=config)
framework_model.eval()
# Load the sample image
pixel_values = get_sample_data(variant)
inputs = [pixel_values]
# Forge compile framework model
> compiled_model = forge.compile(framework_model, sample_inputs=inputs, module_name=module_name)
forge/test/models/pytorch/vision/segformer/test_segformer.py:61:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/compile.py:251: in compile_main
return forge_compile_from_context(compile_context)
/opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/compile.py:293: in forge_compile_from_context
next_stage = stage_to_func[current_stage](context)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
context = CompileContext(modules=[Module pt_segformer_nvidia_mit_b0_img_cls_hf], graph_name='pt_segformer_nvidia_mit_b0_img_cls_...cles_offset=0, forge_module=<forge._C.ForgeGraphModule object at 0x7ff6e2c28070>, compiled_binary=None, attach_to=None)
def run_mlir_compiler(context: CompileContext) -> CompileDepth:
assert context.forge_module is not None
> context.compiled_binary = forge._C.run_mlir_compiler(context.forge_module)
E RuntimeError: Failed to run MLIR compiler pass pipeline.
/opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/compile.py:986: RuntimeError
Check failure on line 134 in forge/test/models/onnx/vision/yolo/test_yolo_v5.py
github-actions / TT-Forge-FE Tests
test_yolo_v5.test_yolov5_480x480[yolov5s]
RuntimeError: Failed to run MLIR compiler pass pipeline.
Raw output
record_forge_property = <test.conftest.ForgePropertyStore object at 0x7ff7778a7880>
size = 's'
@pytest.mark.nightly
@pytest.mark.parametrize("size", size, ids=["yolov5" + s for s in size])
def test_yolov5_480x480(record_forge_property, size):
if size != "s":
pytest.skip("Skipping due to the current CI/CD pipeline limitations")
# Build Module Name
module_name = build_module_name(
framework=Framework.PYTORCH,
model="yolo_v5",
variant="yolov5" + size,
task="imgcls",
source="torchhub",
suffix="480x480",
)
# Record Forge Property
record_forge_property("tags.model_name", module_name)
framework_model, inputs, _ = generate_model_yoloV5I480_imgcls_torchhub_pytorch(
"ultralytics/yolov5",
size=size,
)
# Forge compile framework model
> compiled_model = forge.compile(framework_model, sample_inputs=inputs, module_name=module_name)
forge/test/models/pytorch/vision/yolo/test_yolo_v5.py:134:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/compile.py:251: in compile_main
return forge_compile_from_context(compile_context)
/opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/compile.py:293: in forge_compile_from_context
next_stage = stage_to_func[current_stage](context)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
context = CompileContext(modules=[Module pt_yolo_v5_yolov5s_imgcls_torchhub_480x480], graph_name='pt_yolo_v5_yolov5s_imgcls_torc...cles_offset=0, forge_module=<forge._C.ForgeGraphModule object at 0x7ff86b536970>, compiled_binary=None, attach_to=None)
def run_mlir_compiler(context: CompileContext) -> CompileDepth:
assert context.forge_module is not None
> context.compiled_binary = forge._C.run_mlir_compiler(context.forge_module)
E RuntimeError: Failed to run MLIR compiler pass pipeline.
/opt/ttforge-toolchain/venv/lib/python3.10/site-packages/forge/compile.py:986: RuntimeError