Skip to content

Uplift third_party/tt-mlir to origin/main 2024-12-22 (#949) #335

Uplift third_party/tt-mlir to origin/main 2024-12-22 (#949)

Uplift third_party/tt-mlir to origin/main 2024-12-22 (#949) #335

GitHub Actions / TT-Forge-FE Tests failed Dec 23, 2024 in 0s

182 tests run, 96 passed, 74 skipped, 12 failed.

Annotations

Check failure on line 55 in forge/test/models/pytorch/text/bart/test_bart.py

See this annotation in the file changed.

@github-actions github-actions / TT-Forge-FE Tests

test_bart.test_pt_bart_classifier[no_device]

RuntimeError: TT_ASSERT @ /__w/tt-forge-fe/tt-forge-fe/forge/csrc/passes/commute_utils.cpp:1105: reshape->op_name() == "reshape"
info:
update_reshape_attr called for a non-reshape operation
backtrace:
 --- tt::passes::update_reshape_attr(tt::graphlib::OpNode*, tt::graphlib::Shape)
 --- tt::passes::commute_and_bypass(tt::graphlib::Graph*, std::vector<tt::graphlib::Node*, std::allocator<tt::graphlib::Node*> > const&)
 --- tt::passes::erase_inverse_ops(tt::graphlib::Graph*)
 --- tt::run_optimization_graph_passes(tt::graphlib::Graph*)
 --- /__w/tt-forge-fe/tt-forge-fe/forge/forge/_C.so(+0xfc649) [0x7f1800a55649]
 --- /__w/tt-forge-fe/tt-forge-fe/forge/forge/_C.so(+0xdf905) [0x7f1800a38905]
 --- /opt/ttforge-toolchain/venv/bin/python(+0x18b282) [0x5618e4ac0282]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_MakeTpCall+0x25b) [0x5618e4ab6b4b]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x5c7d) [0x5618e4aaff4d]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x6d2) [0x5618e4aaa9a2]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x6d2) [0x5618e4aaa9a2]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x1a22) [0x5618e4aabcf2]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(PyObject_Call+0x122) [0x5618e4ace882]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2c89) [0x5618e4aacf59]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2c89) [0x5618e4aacf59]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x1a22) [0x5618e4aabcf2]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x58aa) [0x5618e4aafb7a]
 --- /opt/ttforge-toolchain/venv/bin/python(+0x198be1) [0x5618e4acdbe1]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x58aa) [0x5618e4aafb7a]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_FastCallDictTstate+0x16d) [0x5618e4ab5dbd]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_Call_Prepend+0x5c) [0x5618e4acad4c]
 --- /opt/ttforge-toolchain/venv/bin/python(+0x29e054) [0x5618e4bd3054]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_MakeTpCall+0x25b) [0x5618e4ab6b4b]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x671a) [0x5618e4ab09ea]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x818) [0x5618e4aaaae8]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2c89) [0x5618e4aacf59]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x1a22) [0x5618e4aabcf2]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x58aa) [0x5618e4aafb7a]
 --- /opt/ttforge-toolchain/venv/bin/python(+0x198be1) [0x5618e4acdbe1]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x58aa) [0x5618e4aafb7a]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_FastCallDictTstate+0x16d) [0x5618e4ab5dbd]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_Call_Prepend+0x5c) [0x5618e4acad4c]
 --- /opt/ttforge-toolchain/venv/bin/python(+0x29e054) [0x5618e4bd3054]
 --- /opt/ttforge-toolchain/venv/bin/python(PyObject_Call+0xbb) [0x5618e4ace81b]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2c89) [0x5618e4aacf59]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x6d2) [0x5618e4aaa9a2]
 --- /opt/ttforge-toolchain/venv/bin/python(+0x198be1) [0x5618e4acdbe1]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x1a22) [0x5618e4aabcf2]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2c89) [0x5618e4aacf59]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x6d2) [0x5618e4aaa9a2]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x1a22) [0x5618e4aabcf2]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2c89) [0x5618e4aacf59]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x1a22) [0x5618e4aabcf2]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x58aa) [0x5618e4aafb7a]
 --- /opt/ttforge-toolchain/venv/bin/python(+0x198be1) [0x5618e4acdbe1]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x58aa) [0x5618e4aafb7a]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_FastCallDictTstate+0x16d) [0x5618e4ab5dbd]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_Call_Prepend+0x5c) [0x5618e4acad4c]
 --- /opt/ttforge-toolchain/venv/bin/python(+0x29e054) [0x5618e4bd3054]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_MakeTpCall+0x25b) [0x5618e4ab6b4b]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x671a) [0x5618e4ab09ea]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2c89) [0x5618e4aacf59]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x1a22) [0x5618e4aabcf2]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x58aa) [0x5618e4aafb7a]
 --- /opt/ttforge-toolchain/venv/bin/python(+0x198be1) [0x5618e4acdbe1]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x58aa) [0x5618e4aafb7a]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_FastCallDictTstate+0x16d) [0x5618e4ab5dbd]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_Call_Prepend+0x5c) [0x5618e4acad4c]
 --- /opt/ttforge-toolchain/venv/bin/python(+0x29e054) [0x5618e4bd3054]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_MakeTpCall+0x25b) [0x5618e4ab6b4b]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x671a) [0x5618e4ab09ea]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x6d2) [0x5618e4aaa9a2]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x6d2) [0x5618e4aaa9a2]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2c89) [0x5618e4aacf59]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x1a22) [0x5618e4aabcf2]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x58aa) [0x5618e4aafb7a]
 --- /opt/ttforge-toolchain/venv/bin/python(+0x198be1) [0x5618e4acdbe1]
Raw output
test_device = None

    @pytest.mark.nightly
    @pytest.mark.model_analysis
    def test_pt_bart_classifier(test_device):
        compiler_cfg = _get_global_compiler_config()
        compiler_cfg.compile_depth = CompileDepth.SPLIT_GRAPH
    
        model_name = f"facebook/bart-large-mnli"
        model = download_model(BartForSequenceClassification.from_pretrained, model_name, torchscript=True)
        tokenizer = download_model(BartTokenizer.from_pretrained, model_name, pad_to_max_length=True)
        hypothesis = "Most of Mrinal Sen's work can be found in European collections."
        premise = "Calcutta seems to be the only other production center having any pretensions to artistic creativity at all, but ironically you're actually more likely to see the works of Satyajit Ray or Mrinal Sen shown in Europe or North America than in India itself."
    
        # generate inputs
        inputs_dict = tokenizer(
            premise,
            hypothesis,
            truncation=True,
            padding="max_length",
            max_length=256,
            truncation_strategy="only_first",
            return_tensors="pt",
        )
        decoder_input_ids = shift_tokens_right(
            inputs_dict["input_ids"], model.config.pad_token_id, model.config.decoder_start_token_id
        )
        inputs = [inputs_dict["input_ids"], inputs_dict["attention_mask"], decoder_input_ids]
    
        # Compile & feed data
        pt_mod = BartWrapper(model.model)
    
>       compiled_model = forge.compile(pt_mod, sample_inputs=inputs, module_name="pt_bart")

forge/test/models/pytorch/text/bart/test_bart.py:55: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
forge/forge/compile.py:250: in compile_main
    return forge_compile_from_context(compile_context)
forge/forge/compile.py:292: in forge_compile_from_context
    next_stage = stage_to_func[current_stage](context)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

context = CompileContext(modules=[Module pt_bart], graph_name='pt_bart', compiler_cfg=CompilerConfig(enable_training=False, enab...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/passes/commute_utils.cpp:1105: reshape->op_name() == "reshape"
E       info:
E       update_reshape_attr called for a non-reshape operation
E       backtrace:
E        --- tt::passes::update_reshape_attr(tt::graphlib::OpNode*, tt::graphlib::Shape)
E        --- tt::passes::commute_and_bypass(tt::graphlib::Graph*, std::vector<tt::graphlib::Node*, std::allocator<tt::graphlib::Node*> > const&)
E        --- tt::passes::erase_inverse_ops(tt::graphlib::Graph*)
E        --- tt::run_optimization_graph_passes(tt::graphlib::Graph*)
E        --- /__w/tt-forge-fe/tt-forge-fe/forge/forge/_C.so(+0xfc649) [0x7f1800a55649]
E        --- /__w/tt-forge-fe/tt-forge-fe/forge/forge/_C.so(+0xdf905) [0x7f1800a38905]
E        --- /opt/ttforge-toolchain/venv/bin/python(+0x18b282) [0x5618e4ac0282]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_MakeTpCall+0x25b) [0x5618e4ab6b4b]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x5c7d) [0x5618e4aaff4d]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x6d2) [0x5618e4aaa9a2]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x6d2) [0x5618e4aaa9a2]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x1a22) [0x5618e4aabcf2]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(PyObject_Call+0x122) [0x5618e4ace882]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2c89) [0x5618e4aacf59]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2c89) [0x5618e4aacf59]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x1a22) [0x5618e4aabcf2]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x58aa) [0x5618e4aafb7a]
E        --- /opt/ttforge-toolchain/venv/bin/python(+0x198be1) [0x5618e4acdbe1]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x58aa) [0x5618e4aafb7a]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_FastCallDictTstate+0x16d) [0x5618e4ab5dbd]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_Call_Prepend+0x5c) [0x5618e4acad4c]
E        --- /opt/ttforge-toolchain/venv/bin/python(+0x29e054) [0x5618e4bd3054]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_MakeTpCall+0x25b) [0x5618e4ab6b4b]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x671a) [0x5618e4ab09ea]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x818) [0x5618e4aaaae8]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2c89) [0x5618e4aacf59]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x1a22) [0x5618e4aabcf2]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x58aa) [0x5618e4aafb7a]
E        --- /opt/ttforge-toolchain/venv/bin/python(+0x198be1) [0x5618e4acdbe1]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x58aa) [0x5618e4aafb7a]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_FastCallDictTstate+0x16d) [0x5618e4ab5dbd]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_Call_Prepend+0x5c) [0x5618e4acad4c]
E        --- /opt/ttforge-toolchain/venv/bin/python(+0x29e054) [0x5618e4bd3054]
E        --- /opt/ttforge-toolchain/venv/bin/python(PyObject_Call+0xbb) [0x5618e4ace81b]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2c89) [0x5618e4aacf59]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x6d2) [0x5618e4aaa9a2]
E        --- /opt/ttforge-toolchain/venv/bin/python(+0x198be1) [0x5618e4acdbe1]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x1a22) [0x5618e4aabcf2]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2c89) [0x5618e4aacf59]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x6d2) [0x5618e4aaa9a2]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x1a22) [0x5618e4aabcf2]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2c89) [0x5618e4aacf59]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x1a22) [0x5618e4aabcf2]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x58aa) [0x5618e4aafb7a]
E        --- /opt/ttforge-toolchain/venv/bin/python(+0x198be1) [0x5618e4acdbe1]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x58aa) [0x5618e4aafb7a]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_FastCallDictTstate+0x16d) [0x5618e4ab5dbd]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_Call_Prepend+0x5c) [0x5618e4acad4c]
E        --- /opt/ttforge-toolchain/venv/bin/python(+0x29e054) [0x5618e4bd3054]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_MakeTpCall+0x25b) [0x5618e4ab6b4b]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x671a) [0x5618e4ab09ea]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2c89) [0x5618e4aacf59]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x1a22) [0x5618e4aabcf2]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x58aa) [0x5618e4aafb7a]
E        --- /opt/ttforge-toolchain/venv/bin/python(+0x198be1) [0x5618e4acdbe1]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x58aa) [0x5618e4aafb7a]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_FastCallDictTstate+0x16d) [0x5618e4ab5dbd]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_Call_Prepend+0x5c) [0x5618e4acad4c]
E        --- /opt/ttforge-toolchain/venv/bin/python(+0x29e054) [0x5618e4bd3054]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_MakeTpCall+0x25b) [0x5618e4ab6b4b]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x671a) [0x5618e4ab09ea]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x6d2) [0x5618e4aaa9a2]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x6d2) [0x5618e4aaa9a2]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2c89) [0x5618e4aacf59]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x1a22) [0x5618e4aabcf2]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x58aa) [0x5618e4aafb7a]
E        --- /opt/ttforge-toolchain/venv/bin/python(+0x198be1) [0x5618e4acdbe1]

forge/forge/compile.py:785: RuntimeError

Check failure on line 141 in forge/test/models/pytorch/text/bert/test_bert.py

See this annotation in the file changed.

@github-actions github-actions / TT-Forge-FE Tests

test_bert.test_bert_sequence_classification_pytorch[no_device]

TypeError: 'CompileResults' object is not callable
Raw output
test_device = None

    @pytest.mark.nightly
    @pytest.mark.model_analysis
    def test_bert_sequence_classification_pytorch(test_device):
        model, inputs, _ = generate_model_bert_seqcls_hf_pytorch(
            "textattack/bert-base-uncased-SST-2",
        )
    
        compiled_model = forge.compile(model, sample_inputs=inputs, module_name="pt_bert_sequence_classification")
    
>       co_out = compiled_model(*inputs)
E       TypeError: 'CompileResults' object is not callable

forge/test/models/pytorch/text/bert/test_bert.py:141: TypeError

Check failure on line 65 in forge/test/models/pytorch/text/gptneo/test_gptneo.py

See this annotation in the file changed.

@github-actions github-actions / TT-Forge-FE Tests

test_gptneo.test_gptneo_causal_lm[no_device-EleutherAI/gpt-neo-125M]

AssertionError: Data mismatch on output 0 between framework and Forge codegen
Raw output
variant = 'EleutherAI/gpt-neo-125M', test_device = None

    @pytest.mark.nightly
    @pytest.mark.model_analysis
    @pytest.mark.parametrize("variant", variants, ids=variants)
    def test_gptneo_causal_lm(variant, test_device):
        # Set random seed for repeatability
        torch.manual_seed(42)
    
        # Configurations
        compiler_cfg = forge.config._get_global_compiler_config()
        compiler_cfg.compile_depth = forge.CompileDepth.SPLIT_GRAPH
    
        # Load tokenizer and model
        # Variants: # EleutherAI/gpt-neo-125M, EleutherAI/gpt-neo-1.3B,
        # EleutherAI/gpt-neo-2.7B
    
        config = download_model(GPTNeoConfig.from_pretrained, variant)
        config_dict = config.to_dict()
        config_dict["return_dict"] = False
        config_dict["use_cache"] = False
        config = GPTNeoConfig(**config_dict)
    
        tokenizer = download_model(AutoTokenizer.from_pretrained, variant)
        tokenizer.pad_token = tokenizer.eos_token
        model = download_model(GPTNeoForCausalLM.from_pretrained, variant, config=config)
    
        # Sample input text
        prompt = "My name is Bert, and I am"
    
        inputs = tokenizer(prompt, return_tensors="pt", max_length=256, pad_to_max_length=True, truncation=True)
    
        # Wrapper to get around attention mask
        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)
    
        inputs = [inputs["input_ids"], inputs["attention_mask"]]
>       compiled_model = forge.compile(
            Wrapper(model),
            sample_inputs=inputs,
            module_name="pt_" + str(variant.split("/")[-1].replace("-", "_").replace(".", "_")) + "_causal_lm",
        )

forge/test/models/pytorch/text/gptneo/test_gptneo.py:65: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
forge/forge/compile.py:250: in compile_main
    return forge_compile_from_context(compile_context)
forge/forge/compile.py:292: in forge_compile_from_context
    next_stage = stage_to_func[current_stage](context)
forge/forge/compile.py:634: in generate_initial_graph
    module, module_inputs = convert_to_forge_module(
forge/forge/compile.py:973: in convert_to_forge_module
    forge_module, dev_types, module_inputs = generate_forge_module(
forge/forge/tvm_to_python.py:2136: in generate_forge_module
    verify_framework_vs_forge_codegen(framework_outputs, forge_outputs, verify_cfg=verify_cfg)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

frame_outputs = [tensor([[[ -2.93149,  -3.04098,  -5.19186,  ..., -11.81308,  -8.60934,  -6.07345],
         [ -6.99371,  -5.94796, -1...],
         [-38.90412, -38.28091, -42.97676,  ..., -69.93178, -49.82716, -37.80742]]], grad_fn=<UnsafeViewBackward0>)]
forge_outputs = (Forge Tensor: tensor([[[ -2.93151,  -3.04100,  -5.19192,  ..., -11.81311,  -8.60940,  -6.07350],
         [ -6.99369,...2,  -5.60490,  -4.23273,  ..., -16.88002, -15.43275,  -9.50537]]], grad_fn=<UnsafeViewBackward0>), DataFormat.Float32,)
verify_cfg = DepricatedVerifyConfig(graph_name='graph', enabled=False, intermediates=False, rtol={torch.float32: None, torch.float1...ent_checking=True, enable_parameter_gradient_checking=True, _input_gradient_queue=None, _parameter_gradient_queue=None)

    def verify_framework_vs_forge_codegen(frame_outputs, forge_outputs, verify_cfg):
        from forge.verify.compare import compare_tensor_to_golden
    
        test_pass = True
        for i, (golden, output) in enumerate(zip(frame_outputs, forge_outputs)):
            test_pass &= compare_tensor_to_golden(
                f"Framework vs. Forge codegen output {i}", golden, output.value(), is_forge=False, verify_cfg=verify_cfg
            )
    
>           assert test_pass, f"Data mismatch on output {i} between framework and Forge codegen"
E           AssertionError: Data mismatch on output 0 between framework and Forge codegen

forge/forge/tvm_to_python.py:1985: AssertionError

Check failure on line 116 in forge/test/models/pytorch/text/gptneo/test_gptneo.py

See this annotation in the file changed.

@github-actions github-actions / TT-Forge-FE Tests

test_gptneo.test_gptneo_sequence_classification[no_device-EleutherAI/gpt-neo-1.3B]

AssertionError: Data mismatch on output 3 between framework and Forge codegen
Raw output
variant = 'EleutherAI/gpt-neo-1.3B', test_device = None

    @pytest.mark.nightly
    @pytest.mark.parametrize("variant", variants, ids=variants)
    def test_gptneo_sequence_classification(variant, test_device):
        # Load tokenizer and model from HuggingFace
        # Variants: # EleutherAI/gpt-neo-125M, EleutherAI/gpt-neo-1.3B,
        # EleutherAI/gpt-neo-2.7B
    
        # Configurations
        compiler_cfg = forge.config._get_global_compiler_config()
        compiler_cfg.compile_depth = forge.CompileDepth.SPLIT_GRAPH
    
        tokenizer = download_model(AutoTokenizer.from_pretrained, variant)
        tokenizer.pad_token = tokenizer.eos_token
        model = download_model(GPTNeoForSequenceClassification.from_pretrained, variant, torchscript=True)
    
        # Load data sample
        review = "the movie was great!"
    
        # Data preprocessing
        input_tokens = tokenizer(
            review,
            max_length=32,
            padding="max_length",
            truncation=True,
            return_tensors="pt",
        )
    
        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)
    
        inputs = [input_tokens["input_ids"], input_tokens["attention_mask"]]
    
>       compiled_model = forge.compile(
            Wrapper(model),
            sample_inputs=inputs,
            module_name="pt_" + str(variant.split("/")[-1].replace("-", "_").replace(".", "_")) + "_seq_cls",
        )

forge/test/models/pytorch/text/gptneo/test_gptneo.py:116: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
forge/forge/compile.py:250: in compile_main
    return forge_compile_from_context(compile_context)
forge/forge/compile.py:292: in forge_compile_from_context
    next_stage = stage_to_func[current_stage](context)
forge/forge/compile.py:634: in generate_initial_graph
    module, module_inputs = convert_to_forge_module(
forge/forge/compile.py:973: in convert_to_forge_module
    forge_module, dev_types, module_inputs = generate_forge_module(
forge/forge/tvm_to_python.py:2136: in generate_forge_module
    verify_framework_vs_forge_codegen(framework_outputs, forge_outputs, verify_cfg=verify_cfg)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

frame_outputs = [tensor([[ 2.02300, -1.06290]], grad_fn=<IndexBackward0>), tensor([[[[-8.65128e-02,  1.82043e-01,  2.00490e-01,  ..., ...51],
          [ 0.65266,  0.77656, -0.42172,  ..., -0.43564,  0.00645, -0.18691]]]], grad_fn=<PermuteBackward0>), ...]
forge_outputs = (Forge Tensor: tensor([[ 2.36522, -0.28600]], grad_fn=<IndexBackward0>), DataFormat.Float32, Forge Tensor: tensor([[[[...40,  0.44998, -0.12259,  ..., -0.48345,  0.07875, -0.03002]]]], grad_fn=<TransposeBackward0>), DataFormat.Float32, ...)
verify_cfg = DepricatedVerifyConfig(graph_name='graph', enabled=False, intermediates=False, rtol={torch.float32: None, torch.float1...ent_checking=True, enable_parameter_gradient_checking=True, _input_gradient_queue=None, _parameter_gradient_queue=None)

    def verify_framework_vs_forge_codegen(frame_outputs, forge_outputs, verify_cfg):
        from forge.verify.compare import compare_tensor_to_golden
    
        test_pass = True
        for i, (golden, output) in enumerate(zip(frame_outputs, forge_outputs)):
            test_pass &= compare_tensor_to_golden(
                f"Framework vs. Forge codegen output {i}", golden, output.value(), is_forge=False, verify_cfg=verify_cfg
            )
    
>           assert test_pass, f"Data mismatch on output {i} between framework and Forge codegen"
E           AssertionError: Data mismatch on output 3 between framework and Forge codegen

forge/forge/tvm_to_python.py:1985: AssertionError

Check failure on line 116 in forge/test/models/pytorch/text/gptneo/test_gptneo.py

See this annotation in the file changed.

@github-actions github-actions / TT-Forge-FE Tests

test_gptneo.test_gptneo_sequence_classification[no_device-EleutherAI/gpt-neo-2.7B]

AssertionError: Data mismatch on output 0 between framework and Forge codegen
Raw output
variant = 'EleutherAI/gpt-neo-2.7B', test_device = None

    @pytest.mark.nightly
    @pytest.mark.parametrize("variant", variants, ids=variants)
    def test_gptneo_sequence_classification(variant, test_device):
        # Load tokenizer and model from HuggingFace
        # Variants: # EleutherAI/gpt-neo-125M, EleutherAI/gpt-neo-1.3B,
        # EleutherAI/gpt-neo-2.7B
    
        # Configurations
        compiler_cfg = forge.config._get_global_compiler_config()
        compiler_cfg.compile_depth = forge.CompileDepth.SPLIT_GRAPH
    
        tokenizer = download_model(AutoTokenizer.from_pretrained, variant)
        tokenizer.pad_token = tokenizer.eos_token
        model = download_model(GPTNeoForSequenceClassification.from_pretrained, variant, torchscript=True)
    
        # Load data sample
        review = "the movie was great!"
    
        # Data preprocessing
        input_tokens = tokenizer(
            review,
            max_length=32,
            padding="max_length",
            truncation=True,
            return_tensors="pt",
        )
    
        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)
    
        inputs = [input_tokens["input_ids"], input_tokens["attention_mask"]]
    
>       compiled_model = forge.compile(
            Wrapper(model),
            sample_inputs=inputs,
            module_name="pt_" + str(variant.split("/")[-1].replace("-", "_").replace(".", "_")) + "_seq_cls",
        )

forge/test/models/pytorch/text/gptneo/test_gptneo.py:116: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
forge/forge/compile.py:250: in compile_main
    return forge_compile_from_context(compile_context)
forge/forge/compile.py:292: in forge_compile_from_context
    next_stage = stage_to_func[current_stage](context)
forge/forge/compile.py:634: in generate_initial_graph
    module, module_inputs = convert_to_forge_module(
forge/forge/compile.py:973: in convert_to_forge_module
    forge_module, dev_types, module_inputs = generate_forge_module(
forge/forge/tvm_to_python.py:2136: in generate_forge_module
    verify_framework_vs_forge_codegen(framework_outputs, forge_outputs, verify_cfg=verify_cfg)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

frame_outputs = [tensor([[-1.73945,  3.86908]], grad_fn=<IndexBackward0>), tensor([[[[-0.84780, -0.45597, -0.50286,  ...,  0.32681, -0...70],
          [-0.14309, -0.12644, -0.26851,  ...,  0.24723,  0.67294,  0.32695]]]], grad_fn=<PermuteBackward0>), ...]
forge_outputs = (Forge Tensor: tensor([[ 1.12671, -1.29598]], grad_fn=<IndexBackward0>), DataFormat.Float32, Forge Tensor: tensor([[[[....37702e-03,  ..., -3.20576e-01,  7.41636e-01, -2.53812e-01]]]], grad_fn=<TransposeBackward0>), DataFormat.Float32, ...)
verify_cfg = DepricatedVerifyConfig(graph_name='graph', enabled=False, intermediates=False, rtol={torch.float32: None, torch.float1...ent_checking=True, enable_parameter_gradient_checking=True, _input_gradient_queue=None, _parameter_gradient_queue=None)

    def verify_framework_vs_forge_codegen(frame_outputs, forge_outputs, verify_cfg):
        from forge.verify.compare import compare_tensor_to_golden
    
        test_pass = True
        for i, (golden, output) in enumerate(zip(frame_outputs, forge_outputs)):
            test_pass &= compare_tensor_to_golden(
                f"Framework vs. Forge codegen output {i}", golden, output.value(), is_forge=False, verify_cfg=verify_cfg
            )
    
>           assert test_pass, f"Data mismatch on output {i} between framework and Forge codegen"
E           AssertionError: Data mismatch on output 0 between framework and Forge codegen

forge/forge/tvm_to_python.py:1985: AssertionError

Check failure on line 42 in forge/test/models/pytorch/text/opt/test_opt.py

See this annotation in the file changed.

@github-actions github-actions / TT-Forge-FE Tests

test_opt.test_opt_causal_lm[no_device-facebook/opt-350m]

RuntimeError: TT_ASSERT @ /__w/tt-forge-fe/tt-forge-fe/forge/csrc/passes/commute_utils.cpp:1105: reshape->op_name() == "reshape"
info:
update_reshape_attr called for a non-reshape operation
backtrace:
 --- tt::passes::update_reshape_attr(tt::graphlib::OpNode*, tt::graphlib::Shape)
 --- tt::passes::commute_and_bypass(tt::graphlib::Graph*, std::vector<tt::graphlib::Node*, std::allocator<tt::graphlib::Node*> > const&)
 --- tt::passes::erase_inverse_ops(tt::graphlib::Graph*)
 --- tt::run_optimization_graph_passes(tt::graphlib::Graph*)
 --- /__w/tt-forge-fe/tt-forge-fe/forge/forge/_C.so(+0xfc649) [0x7f1800a55649]
 --- /__w/tt-forge-fe/tt-forge-fe/forge/forge/_C.so(+0xdf905) [0x7f1800a38905]
 --- /opt/ttforge-toolchain/venv/bin/python(+0x18b282) [0x5618e4ac0282]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_MakeTpCall+0x25b) [0x5618e4ab6b4b]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x5c7d) [0x5618e4aaff4d]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x6d2) [0x5618e4aaa9a2]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x6d2) [0x5618e4aaa9a2]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x1a22) [0x5618e4aabcf2]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(PyObject_Call+0x122) [0x5618e4ace882]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2c89) [0x5618e4aacf59]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2c89) [0x5618e4aacf59]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x1a22) [0x5618e4aabcf2]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x58aa) [0x5618e4aafb7a]
 --- /opt/ttforge-toolchain/venv/bin/python(+0x198be1) [0x5618e4acdbe1]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x58aa) [0x5618e4aafb7a]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_FastCallDictTstate+0x16d) [0x5618e4ab5dbd]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_Call_Prepend+0x5c) [0x5618e4acad4c]
 --- /opt/ttforge-toolchain/venv/bin/python(+0x29e054) [0x5618e4bd3054]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_MakeTpCall+0x25b) [0x5618e4ab6b4b]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x671a) [0x5618e4ab09ea]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x818) [0x5618e4aaaae8]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2c89) [0x5618e4aacf59]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x1a22) [0x5618e4aabcf2]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x58aa) [0x5618e4aafb7a]
 --- /opt/ttforge-toolchain/venv/bin/python(+0x198be1) [0x5618e4acdbe1]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x58aa) [0x5618e4aafb7a]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_FastCallDictTstate+0x16d) [0x5618e4ab5dbd]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_Call_Prepend+0x5c) [0x5618e4acad4c]
 --- /opt/ttforge-toolchain/venv/bin/python(+0x29e054) [0x5618e4bd3054]
 --- /opt/ttforge-toolchain/venv/bin/python(PyObject_Call+0xbb) [0x5618e4ace81b]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2c89) [0x5618e4aacf59]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x6d2) [0x5618e4aaa9a2]
 --- /opt/ttforge-toolchain/venv/bin/python(+0x198be1) [0x5618e4acdbe1]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x1a22) [0x5618e4aabcf2]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2c89) [0x5618e4aacf59]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x6d2) [0x5618e4aaa9a2]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x1a22) [0x5618e4aabcf2]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2c89) [0x5618e4aacf59]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x1a22) [0x5618e4aabcf2]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x58aa) [0x5618e4aafb7a]
 --- /opt/ttforge-toolchain/venv/bin/python(+0x198be1) [0x5618e4acdbe1]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x58aa) [0x5618e4aafb7a]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_FastCallDictTstate+0x16d) [0x5618e4ab5dbd]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_Call_Prepend+0x5c) [0x5618e4acad4c]
 --- /opt/ttforge-toolchain/venv/bin/python(+0x29e054) [0x5618e4bd3054]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_MakeTpCall+0x25b) [0x5618e4ab6b4b]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x671a) [0x5618e4ab09ea]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2c89) [0x5618e4aacf59]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x1a22) [0x5618e4aabcf2]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x58aa) [0x5618e4aafb7a]
 --- /opt/ttforge-toolchain/venv/bin/python(+0x198be1) [0x5618e4acdbe1]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x58aa) [0x5618e4aafb7a]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_FastCallDictTstate+0x16d) [0x5618e4ab5dbd]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_Call_Prepend+0x5c) [0x5618e4acad4c]
 --- /opt/ttforge-toolchain/venv/bin/python(+0x29e054) [0x5618e4bd3054]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_MakeTpCall+0x25b) [0x5618e4ab6b4b]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x671a) [0x5618e4ab09ea]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x6d2) [0x5618e4aaa9a2]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x6d2) [0x5618e4aaa9a2]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2c89) [0x5618e4aacf59]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x1a22) [0x5618e4aabcf2]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x58aa) [0x5618e4aafb7a]
 --- /opt/ttforge-toolchain/venv/bin/python(+0x198be1) [0x5618e4acdbe1]
Raw output
variant = 'facebook/opt-350m', test_device = None

    @pytest.mark.nightly
    @pytest.mark.model_analysis
    @pytest.mark.parametrize("variant", variants, ids=variants)
    def test_opt_causal_lm(variant, test_device):
        # Load tokenizer and model from HuggingFace
        # Variants: "facebook/opt-125m", "facebook/opt-350m", "facebook/opt-1.3b"
    
        compiler_cfg = forge.config._get_global_compiler_config()
        compiler_cfg.compile_depth = forge.CompileDepth.SPLIT_GRAPH
    
        config = OPTConfig.from_pretrained(variant)
        config_dict = config.to_dict()
        config_dict["return_dict"] = False
        config_dict["use_cache"] = False
        config = OPTConfig(**config_dict)
        model = download_model(OPTForCausalLM.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"]]
>       compiled_model = forge.compile(
            model,
            sample_inputs=inputs,
            module_name="pt_" + str(variant.split("/")[-1].replace("-", "_").replace(".", "_")) + "_causal_lm",
        )

forge/test/models/pytorch/text/opt/test_opt.py:42: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
forge/forge/compile.py:250: in compile_main
    return forge_compile_from_context(compile_context)
forge/forge/compile.py:292: in forge_compile_from_context
    next_stage = stage_to_func[current_stage](context)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

context = CompileContext(modules=[Module pt_opt_350m_causal_lm], graph_name='pt_opt_350m_causal_lm', compiler_cfg=CompilerConfig...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/passes/commute_utils.cpp:1105: reshape->op_name() == "reshape"
E       info:
E       update_reshape_attr called for a non-reshape operation
E       backtrace:
E        --- tt::passes::update_reshape_attr(tt::graphlib::OpNode*, tt::graphlib::Shape)
E        --- tt::passes::commute_and_bypass(tt::graphlib::Graph*, std::vector<tt::graphlib::Node*, std::allocator<tt::graphlib::Node*> > const&)
E        --- tt::passes::erase_inverse_ops(tt::graphlib::Graph*)
E        --- tt::run_optimization_graph_passes(tt::graphlib::Graph*)
E        --- /__w/tt-forge-fe/tt-forge-fe/forge/forge/_C.so(+0xfc649) [0x7f1800a55649]
E        --- /__w/tt-forge-fe/tt-forge-fe/forge/forge/_C.so(+0xdf905) [0x7f1800a38905]
E        --- /opt/ttforge-toolchain/venv/bin/python(+0x18b282) [0x5618e4ac0282]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_MakeTpCall+0x25b) [0x5618e4ab6b4b]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x5c7d) [0x5618e4aaff4d]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x6d2) [0x5618e4aaa9a2]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x6d2) [0x5618e4aaa9a2]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x1a22) [0x5618e4aabcf2]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(PyObject_Call+0x122) [0x5618e4ace882]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2c89) [0x5618e4aacf59]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2c89) [0x5618e4aacf59]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x1a22) [0x5618e4aabcf2]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x58aa) [0x5618e4aafb7a]
E        --- /opt/ttforge-toolchain/venv/bin/python(+0x198be1) [0x5618e4acdbe1]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x58aa) [0x5618e4aafb7a]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_FastCallDictTstate+0x16d) [0x5618e4ab5dbd]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_Call_Prepend+0x5c) [0x5618e4acad4c]
E        --- /opt/ttforge-toolchain/venv/bin/python(+0x29e054) [0x5618e4bd3054]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_MakeTpCall+0x25b) [0x5618e4ab6b4b]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x671a) [0x5618e4ab09ea]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x818) [0x5618e4aaaae8]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2c89) [0x5618e4aacf59]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x1a22) [0x5618e4aabcf2]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x58aa) [0x5618e4aafb7a]
E        --- /opt/ttforge-toolchain/venv/bin/python(+0x198be1) [0x5618e4acdbe1]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x58aa) [0x5618e4aafb7a]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_FastCallDictTstate+0x16d) [0x5618e4ab5dbd]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_Call_Prepend+0x5c) [0x5618e4acad4c]
E        --- /opt/ttforge-toolchain/venv/bin/python(+0x29e054) [0x5618e4bd3054]
E        --- /opt/ttforge-toolchain/venv/bin/python(PyObject_Call+0xbb) [0x5618e4ace81b]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2c89) [0x5618e4aacf59]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x6d2) [0x5618e4aaa9a2]
E        --- /opt/ttforge-toolchain/venv/bin/python(+0x198be1) [0x5618e4acdbe1]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x1a22) [0x5618e4aabcf2]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2c89) [0x5618e4aacf59]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x6d2) [0x5618e4aaa9a2]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x1a22) [0x5618e4aabcf2]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2c89) [0x5618e4aacf59]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x1a22) [0x5618e4aabcf2]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x58aa) [0x5618e4aafb7a]
E        --- /opt/ttforge-toolchain/venv/bin/python(+0x198be1) [0x5618e4acdbe1]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x58aa) [0x5618e4aafb7a]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_FastCallDictTstate+0x16d) [0x5618e4ab5dbd]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_Call_Prepend+0x5c) [0x5618e4acad4c]
E        --- /opt/ttforge-toolchain/venv/bin/python(+0x29e054) [0x5618e4bd3054]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_MakeTpCall+0x25b) [0x5618e4ab6b4b]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x671a) [0x5618e4ab09ea]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2c89) [0x5618e4aacf59]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x1a22) [0x5618e4aabcf2]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x58aa) [0x5618e4aafb7a]
E        --- /opt/ttforge-toolchain/venv/bin/python(+0x198be1) [0x5618e4acdbe1]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x58aa) [0x5618e4aafb7a]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_FastCallDictTstate+0x16d) [0x5618e4ab5dbd]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_Call_Prepend+0x5c) [0x5618e4acad4c]
E        --- /opt/ttforge-toolchain/venv/bin/python(+0x29e054) [0x5618e4bd3054]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_MakeTpCall+0x25b) [0x5618e4ab6b4b]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x671a) [0x5618e4ab09ea]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x6d2) [0x5618e4aaa9a2]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x6d2) [0x5618e4aaa9a2]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2c89) [0x5618e4aacf59]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x1a22) [0x5618e4aabcf2]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x58aa) [0x5618e4aafb7a]
E        --- /opt/ttforge-toolchain/venv/bin/python(+0x198be1) [0x5618e4acdbe1]

forge/forge/compile.py:785: RuntimeError

Check failure on line 42 in forge/test/models/pytorch/text/opt/test_opt.py

See this annotation in the file changed.

@github-actions github-actions / TT-Forge-FE Tests

test_opt.test_opt_causal_lm[no_device-facebook/opt-1.3b]

RuntimeError: TT_ASSERT @ /__w/tt-forge-fe/tt-forge-fe/forge/csrc/passes/commute_utils.cpp:1105: reshape->op_name() == "reshape"
info:
update_reshape_attr called for a non-reshape operation
backtrace:
 --- tt::passes::update_reshape_attr(tt::graphlib::OpNode*, tt::graphlib::Shape)
 --- tt::passes::commute_and_bypass(tt::graphlib::Graph*, std::vector<tt::graphlib::Node*, std::allocator<tt::graphlib::Node*> > const&)
 --- tt::passes::erase_inverse_ops(tt::graphlib::Graph*)
 --- tt::run_optimization_graph_passes(tt::graphlib::Graph*)
 --- /__w/tt-forge-fe/tt-forge-fe/forge/forge/_C.so(+0xfc649) [0x7f1800a55649]
 --- /__w/tt-forge-fe/tt-forge-fe/forge/forge/_C.so(+0xdf905) [0x7f1800a38905]
 --- /opt/ttforge-toolchain/venv/bin/python(+0x18b282) [0x5618e4ac0282]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_MakeTpCall+0x25b) [0x5618e4ab6b4b]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x5c7d) [0x5618e4aaff4d]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x6d2) [0x5618e4aaa9a2]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x6d2) [0x5618e4aaa9a2]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x1a22) [0x5618e4aabcf2]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(PyObject_Call+0x122) [0x5618e4ace882]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2c89) [0x5618e4aacf59]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2c89) [0x5618e4aacf59]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x1a22) [0x5618e4aabcf2]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x58aa) [0x5618e4aafb7a]
 --- /opt/ttforge-toolchain/venv/bin/python(+0x198be1) [0x5618e4acdbe1]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x58aa) [0x5618e4aafb7a]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_FastCallDictTstate+0x16d) [0x5618e4ab5dbd]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_Call_Prepend+0x5c) [0x5618e4acad4c]
 --- /opt/ttforge-toolchain/venv/bin/python(+0x29e054) [0x5618e4bd3054]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_MakeTpCall+0x25b) [0x5618e4ab6b4b]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x671a) [0x5618e4ab09ea]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x818) [0x5618e4aaaae8]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2c89) [0x5618e4aacf59]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x1a22) [0x5618e4aabcf2]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x58aa) [0x5618e4aafb7a]
 --- /opt/ttforge-toolchain/venv/bin/python(+0x198be1) [0x5618e4acdbe1]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x58aa) [0x5618e4aafb7a]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_FastCallDictTstate+0x16d) [0x5618e4ab5dbd]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_Call_Prepend+0x5c) [0x5618e4acad4c]
 --- /opt/ttforge-toolchain/venv/bin/python(+0x29e054) [0x5618e4bd3054]
 --- /opt/ttforge-toolchain/venv/bin/python(PyObject_Call+0xbb) [0x5618e4ace81b]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2c89) [0x5618e4aacf59]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x6d2) [0x5618e4aaa9a2]
 --- /opt/ttforge-toolchain/venv/bin/python(+0x198be1) [0x5618e4acdbe1]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x1a22) [0x5618e4aabcf2]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2c89) [0x5618e4aacf59]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x6d2) [0x5618e4aaa9a2]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x1a22) [0x5618e4aabcf2]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2c89) [0x5618e4aacf59]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x1a22) [0x5618e4aabcf2]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x58aa) [0x5618e4aafb7a]
 --- /opt/ttforge-toolchain/venv/bin/python(+0x198be1) [0x5618e4acdbe1]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x58aa) [0x5618e4aafb7a]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_FastCallDictTstate+0x16d) [0x5618e4ab5dbd]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_Call_Prepend+0x5c) [0x5618e4acad4c]
 --- /opt/ttforge-toolchain/venv/bin/python(+0x29e054) [0x5618e4bd3054]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_MakeTpCall+0x25b) [0x5618e4ab6b4b]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x671a) [0x5618e4ab09ea]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2c89) [0x5618e4aacf59]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x1a22) [0x5618e4aabcf2]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x58aa) [0x5618e4aafb7a]
 --- /opt/ttforge-toolchain/venv/bin/python(+0x198be1) [0x5618e4acdbe1]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x58aa) [0x5618e4aafb7a]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_FastCallDictTstate+0x16d) [0x5618e4ab5dbd]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_Call_Prepend+0x5c) [0x5618e4acad4c]
 --- /opt/ttforge-toolchain/venv/bin/python(+0x29e054) [0x5618e4bd3054]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_MakeTpCall+0x25b) [0x5618e4ab6b4b]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x671a) [0x5618e4ab09ea]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x6d2) [0x5618e4aaa9a2]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x6d2) [0x5618e4aaa9a2]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2c89) [0x5618e4aacf59]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x1a22) [0x5618e4aabcf2]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x58aa) [0x5618e4aafb7a]
 --- /opt/ttforge-toolchain/venv/bin/python(+0x198be1) [0x5618e4acdbe1]
Raw output
variant = 'facebook/opt-1.3b', test_device = None

    @pytest.mark.nightly
    @pytest.mark.model_analysis
    @pytest.mark.parametrize("variant", variants, ids=variants)
    def test_opt_causal_lm(variant, test_device):
        # Load tokenizer and model from HuggingFace
        # Variants: "facebook/opt-125m", "facebook/opt-350m", "facebook/opt-1.3b"
    
        compiler_cfg = forge.config._get_global_compiler_config()
        compiler_cfg.compile_depth = forge.CompileDepth.SPLIT_GRAPH
    
        config = OPTConfig.from_pretrained(variant)
        config_dict = config.to_dict()
        config_dict["return_dict"] = False
        config_dict["use_cache"] = False
        config = OPTConfig(**config_dict)
        model = download_model(OPTForCausalLM.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"]]
>       compiled_model = forge.compile(
            model,
            sample_inputs=inputs,
            module_name="pt_" + str(variant.split("/")[-1].replace("-", "_").replace(".", "_")) + "_causal_lm",
        )

forge/test/models/pytorch/text/opt/test_opt.py:42: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
forge/forge/compile.py:250: in compile_main
    return forge_compile_from_context(compile_context)
forge/forge/compile.py:292: in forge_compile_from_context
    next_stage = stage_to_func[current_stage](context)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

context = CompileContext(modules=[Module pt_opt_1_3b_causal_lm], graph_name='pt_opt_1_3b_causal_lm', compiler_cfg=CompilerConfig...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/passes/commute_utils.cpp:1105: reshape->op_name() == "reshape"
E       info:
E       update_reshape_attr called for a non-reshape operation
E       backtrace:
E        --- tt::passes::update_reshape_attr(tt::graphlib::OpNode*, tt::graphlib::Shape)
E        --- tt::passes::commute_and_bypass(tt::graphlib::Graph*, std::vector<tt::graphlib::Node*, std::allocator<tt::graphlib::Node*> > const&)
E        --- tt::passes::erase_inverse_ops(tt::graphlib::Graph*)
E        --- tt::run_optimization_graph_passes(tt::graphlib::Graph*)
E        --- /__w/tt-forge-fe/tt-forge-fe/forge/forge/_C.so(+0xfc649) [0x7f1800a55649]
E        --- /__w/tt-forge-fe/tt-forge-fe/forge/forge/_C.so(+0xdf905) [0x7f1800a38905]
E        --- /opt/ttforge-toolchain/venv/bin/python(+0x18b282) [0x5618e4ac0282]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_MakeTpCall+0x25b) [0x5618e4ab6b4b]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x5c7d) [0x5618e4aaff4d]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x6d2) [0x5618e4aaa9a2]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x6d2) [0x5618e4aaa9a2]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x1a22) [0x5618e4aabcf2]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(PyObject_Call+0x122) [0x5618e4ace882]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2c89) [0x5618e4aacf59]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2c89) [0x5618e4aacf59]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x1a22) [0x5618e4aabcf2]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x58aa) [0x5618e4aafb7a]
E        --- /opt/ttforge-toolchain/venv/bin/python(+0x198be1) [0x5618e4acdbe1]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x58aa) [0x5618e4aafb7a]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_FastCallDictTstate+0x16d) [0x5618e4ab5dbd]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_Call_Prepend+0x5c) [0x5618e4acad4c]
E        --- /opt/ttforge-toolchain/venv/bin/python(+0x29e054) [0x5618e4bd3054]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_MakeTpCall+0x25b) [0x5618e4ab6b4b]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x671a) [0x5618e4ab09ea]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x818) [0x5618e4aaaae8]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2c89) [0x5618e4aacf59]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x1a22) [0x5618e4aabcf2]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x58aa) [0x5618e4aafb7a]
E        --- /opt/ttforge-toolchain/venv/bin/python(+0x198be1) [0x5618e4acdbe1]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x58aa) [0x5618e4aafb7a]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_FastCallDictTstate+0x16d) [0x5618e4ab5dbd]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_Call_Prepend+0x5c) [0x5618e4acad4c]
E        --- /opt/ttforge-toolchain/venv/bin/python(+0x29e054) [0x5618e4bd3054]
E        --- /opt/ttforge-toolchain/venv/bin/python(PyObject_Call+0xbb) [0x5618e4ace81b]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2c89) [0x5618e4aacf59]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x6d2) [0x5618e4aaa9a2]
E        --- /opt/ttforge-toolchain/venv/bin/python(+0x198be1) [0x5618e4acdbe1]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x1a22) [0x5618e4aabcf2]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2c89) [0x5618e4aacf59]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x6d2) [0x5618e4aaa9a2]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x1a22) [0x5618e4aabcf2]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2c89) [0x5618e4aacf59]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x1a22) [0x5618e4aabcf2]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x58aa) [0x5618e4aafb7a]
E        --- /opt/ttforge-toolchain/venv/bin/python(+0x198be1) [0x5618e4acdbe1]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x58aa) [0x5618e4aafb7a]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_FastCallDictTstate+0x16d) [0x5618e4ab5dbd]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_Call_Prepend+0x5c) [0x5618e4acad4c]
E        --- /opt/ttforge-toolchain/venv/bin/python(+0x29e054) [0x5618e4bd3054]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_MakeTpCall+0x25b) [0x5618e4ab6b4b]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x671a) [0x5618e4ab09ea]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2c89) [0x5618e4aacf59]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x1a22) [0x5618e4aabcf2]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x58aa) [0x5618e4aafb7a]
E        --- /opt/ttforge-toolchain/venv/bin/python(+0x198be1) [0x5618e4acdbe1]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x58aa) [0x5618e4aafb7a]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_FastCallDictTstate+0x16d) [0x5618e4ab5dbd]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_Call_Prepend+0x5c) [0x5618e4acad4c]
E        --- /opt/ttforge-toolchain/venv/bin/python(+0x29e054) [0x5618e4bd3054]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_MakeTpCall+0x25b) [0x5618e4ab6b4b]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x671a) [0x5618e4ab09ea]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x6d2) [0x5618e4aaa9a2]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x6d2) [0x5618e4aaa9a2]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2c89) [0x5618e4aacf59]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x1a22) [0x5618e4aabcf2]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x58aa) [0x5618e4aafb7a]
E        --- /opt/ttforge-toolchain/venv/bin/python(+0x198be1) [0x5618e4acdbe1]

forge/forge/compile.py:785: RuntimeError

Check failure on line 78 in forge/test/models/pytorch/text/opt/test_opt.py

See this annotation in the file changed.

@github-actions github-actions / TT-Forge-FE Tests

test_opt.test_opt_qa[no_device-facebook/opt-125m]

RuntimeError: TT_ASSERT @ /__w/tt-forge-fe/tt-forge-fe/forge/csrc/passes/commute_utils.cpp:1105: reshape->op_name() == "reshape"
info:
update_reshape_attr called for a non-reshape operation
backtrace:
 --- tt::passes::update_reshape_attr(tt::graphlib::OpNode*, tt::graphlib::Shape)
 --- tt::passes::commute_and_bypass(tt::graphlib::Graph*, std::vector<tt::graphlib::Node*, std::allocator<tt::graphlib::Node*> > const&)
 --- tt::passes::erase_inverse_ops(tt::graphlib::Graph*)
 --- tt::run_optimization_graph_passes(tt::graphlib::Graph*)
 --- /__w/tt-forge-fe/tt-forge-fe/forge/forge/_C.so(+0xfc649) [0x7f1800a55649]
 --- /__w/tt-forge-fe/tt-forge-fe/forge/forge/_C.so(+0xdf905) [0x7f1800a38905]
 --- /opt/ttforge-toolchain/venv/bin/python(+0x18b282) [0x5618e4ac0282]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_MakeTpCall+0x25b) [0x5618e4ab6b4b]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x5c7d) [0x5618e4aaff4d]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x6d2) [0x5618e4aaa9a2]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x6d2) [0x5618e4aaa9a2]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x1a22) [0x5618e4aabcf2]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(PyObject_Call+0x122) [0x5618e4ace882]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2c89) [0x5618e4aacf59]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2c89) [0x5618e4aacf59]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x1a22) [0x5618e4aabcf2]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x58aa) [0x5618e4aafb7a]
 --- /opt/ttforge-toolchain/venv/bin/python(+0x198be1) [0x5618e4acdbe1]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x58aa) [0x5618e4aafb7a]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_FastCallDictTstate+0x16d) [0x5618e4ab5dbd]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_Call_Prepend+0x5c) [0x5618e4acad4c]
 --- /opt/ttforge-toolchain/venv/bin/python(+0x29e054) [0x5618e4bd3054]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_MakeTpCall+0x25b) [0x5618e4ab6b4b]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x671a) [0x5618e4ab09ea]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x818) [0x5618e4aaaae8]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2c89) [0x5618e4aacf59]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x1a22) [0x5618e4aabcf2]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x58aa) [0x5618e4aafb7a]
 --- /opt/ttforge-toolchain/venv/bin/python(+0x198be1) [0x5618e4acdbe1]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x58aa) [0x5618e4aafb7a]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_FastCallDictTstate+0x16d) [0x5618e4ab5dbd]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_Call_Prepend+0x5c) [0x5618e4acad4c]
 --- /opt/ttforge-toolchain/venv/bin/python(+0x29e054) [0x5618e4bd3054]
 --- /opt/ttforge-toolchain/venv/bin/python(PyObject_Call+0xbb) [0x5618e4ace81b]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2c89) [0x5618e4aacf59]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x6d2) [0x5618e4aaa9a2]
 --- /opt/ttforge-toolchain/venv/bin/python(+0x198be1) [0x5618e4acdbe1]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x1a22) [0x5618e4aabcf2]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2c89) [0x5618e4aacf59]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x6d2) [0x5618e4aaa9a2]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x1a22) [0x5618e4aabcf2]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2c89) [0x5618e4aacf59]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x1a22) [0x5618e4aabcf2]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x58aa) [0x5618e4aafb7a]
 --- /opt/ttforge-toolchain/venv/bin/python(+0x198be1) [0x5618e4acdbe1]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x58aa) [0x5618e4aafb7a]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_FastCallDictTstate+0x16d) [0x5618e4ab5dbd]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_Call_Prepend+0x5c) [0x5618e4acad4c]
 --- /opt/ttforge-toolchain/venv/bin/python(+0x29e054) [0x5618e4bd3054]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_MakeTpCall+0x25b) [0x5618e4ab6b4b]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x671a) [0x5618e4ab09ea]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2c89) [0x5618e4aacf59]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x1a22) [0x5618e4aabcf2]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x58aa) [0x5618e4aafb7a]
 --- /opt/ttforge-toolchain/venv/bin/python(+0x198be1) [0x5618e4acdbe1]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x58aa) [0x5618e4aafb7a]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_FastCallDictTstate+0x16d) [0x5618e4ab5dbd]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_Call_Prepend+0x5c) [0x5618e4acad4c]
 --- /opt/ttforge-toolchain/venv/bin/python(+0x29e054) [0x5618e4bd3054]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_MakeTpCall+0x25b) [0x5618e4ab6b4b]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x671a) [0x5618e4ab09ea]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x6d2) [0x5618e4aaa9a2]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x6d2) [0x5618e4aaa9a2]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2c89) [0x5618e4aacf59]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x1a22) [0x5618e4aabcf2]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x58aa) [0x5618e4aafb7a]
 --- /opt/ttforge-toolchain/venv/bin/python(+0x198be1) [0x5618e4acdbe1]
Raw output
variant = 'facebook/opt-125m', test_device = None

    @pytest.mark.nightly
    @pytest.mark.model_analysis
    @pytest.mark.parametrize("variant", variants, ids=variants)
    def test_opt_qa(variant, test_device):
        # Load tokenizer and model from HuggingFace
        # Variants: "facebook/opt-125m", "facebook/opt-350m", "facebook/opt-1.3b"
        # NOTE: These model variants are pre-trined only. They need to be fine-tuned
        # on a downstream task. Code is for demonstration purposes only.
    
        compiler_cfg = forge.config._get_global_compiler_config()
        compiler_cfg.compile_depth = forge.CompileDepth.SPLIT_GRAPH
    
        tokenizer = download_model(AutoTokenizer.from_pretrained, variant)
        model = download_model(OPTForQuestionAnswering.from_pretrained, variant, torchscript=True)
    
        # Load data sample
        question, context = "Who was Jim Henson?", "Jim Henson was a nice puppet"
    
        # Data preprocessing
        input_tokens = tokenizer(
            question,
            context,
            max_length=32,
            padding="max_length",
            truncation=True,
            return_tensors="pt",
        )
    
        inputs = [input_tokens["input_ids"], input_tokens["attention_mask"]]
>       compiled_model = forge.compile(
            model,
            sample_inputs=inputs,
            module_name="pt_" + str(variant.split("/")[-1].replace("-", "_").replace(".", "_")) + "_qa",
        )

forge/test/models/pytorch/text/opt/test_opt.py:78: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
forge/forge/compile.py:250: in compile_main
    return forge_compile_from_context(compile_context)
forge/forge/compile.py:292: in forge_compile_from_context
    next_stage = stage_to_func[current_stage](context)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

context = CompileContext(modules=[Module pt_opt_125m_qa], graph_name='pt_opt_125m_qa', compiler_cfg=CompilerConfig(enable_traini...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/passes/commute_utils.cpp:1105: reshape->op_name() == "reshape"
E       info:
E       update_reshape_attr called for a non-reshape operation
E       backtrace:
E        --- tt::passes::update_reshape_attr(tt::graphlib::OpNode*, tt::graphlib::Shape)
E        --- tt::passes::commute_and_bypass(tt::graphlib::Graph*, std::vector<tt::graphlib::Node*, std::allocator<tt::graphlib::Node*> > const&)
E        --- tt::passes::erase_inverse_ops(tt::graphlib::Graph*)
E        --- tt::run_optimization_graph_passes(tt::graphlib::Graph*)
E        --- /__w/tt-forge-fe/tt-forge-fe/forge/forge/_C.so(+0xfc649) [0x7f1800a55649]
E        --- /__w/tt-forge-fe/tt-forge-fe/forge/forge/_C.so(+0xdf905) [0x7f1800a38905]
E        --- /opt/ttforge-toolchain/venv/bin/python(+0x18b282) [0x5618e4ac0282]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_MakeTpCall+0x25b) [0x5618e4ab6b4b]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x5c7d) [0x5618e4aaff4d]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x6d2) [0x5618e4aaa9a2]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x6d2) [0x5618e4aaa9a2]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x1a22) [0x5618e4aabcf2]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(PyObject_Call+0x122) [0x5618e4ace882]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2c89) [0x5618e4aacf59]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2c89) [0x5618e4aacf59]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x1a22) [0x5618e4aabcf2]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x58aa) [0x5618e4aafb7a]
E        --- /opt/ttforge-toolchain/venv/bin/python(+0x198be1) [0x5618e4acdbe1]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x58aa) [0x5618e4aafb7a]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_FastCallDictTstate+0x16d) [0x5618e4ab5dbd]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_Call_Prepend+0x5c) [0x5618e4acad4c]
E        --- /opt/ttforge-toolchain/venv/bin/python(+0x29e054) [0x5618e4bd3054]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_MakeTpCall+0x25b) [0x5618e4ab6b4b]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x671a) [0x5618e4ab09ea]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x818) [0x5618e4aaaae8]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2c89) [0x5618e4aacf59]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x1a22) [0x5618e4aabcf2]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x58aa) [0x5618e4aafb7a]
E        --- /opt/ttforge-toolchain/venv/bin/python(+0x198be1) [0x5618e4acdbe1]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x58aa) [0x5618e4aafb7a]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_FastCallDictTstate+0x16d) [0x5618e4ab5dbd]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_Call_Prepend+0x5c) [0x5618e4acad4c]
E        --- /opt/ttforge-toolchain/venv/bin/python(+0x29e054) [0x5618e4bd3054]
E        --- /opt/ttforge-toolchain/venv/bin/python(PyObject_Call+0xbb) [0x5618e4ace81b]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2c89) [0x5618e4aacf59]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x6d2) [0x5618e4aaa9a2]
E        --- /opt/ttforge-toolchain/venv/bin/python(+0x198be1) [0x5618e4acdbe1]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x1a22) [0x5618e4aabcf2]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2c89) [0x5618e4aacf59]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x6d2) [0x5618e4aaa9a2]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x1a22) [0x5618e4aabcf2]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2c89) [0x5618e4aacf59]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x1a22) [0x5618e4aabcf2]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x58aa) [0x5618e4aafb7a]
E        --- /opt/ttforge-toolchain/venv/bin/python(+0x198be1) [0x5618e4acdbe1]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x58aa) [0x5618e4aafb7a]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_FastCallDictTstate+0x16d) [0x5618e4ab5dbd]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_Call_Prepend+0x5c) [0x5618e4acad4c]
E        --- /opt/ttforge-toolchain/venv/bin/python(+0x29e054) [0x5618e4bd3054]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_MakeTpCall+0x25b) [0x5618e4ab6b4b]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x671a) [0x5618e4ab09ea]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2c89) [0x5618e4aacf59]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x1a22) [0x5618e4aabcf2]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x58aa) [0x5618e4aafb7a]
E        --- /opt/ttforge-toolchain/venv/bin/python(+0x198be1) [0x5618e4acdbe1]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x58aa) [0x5618e4aafb7a]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_FastCallDictTstate+0x16d) [0x5618e4ab5dbd]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_Call_Prepend+0x5c) [0x5618e4acad4c]
E        --- /opt/ttforge-toolchain/venv/bin/python(+0x29e054) [0x5618e4bd3054]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_MakeTpCall+0x25b) [0x5618e4ab6b4b]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x671a) [0x5618e4ab09ea]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x6d2) [0x5618e4aaa9a2]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x6d2) [0x5618e4aaa9a2]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2c89) [0x5618e4aacf59]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x1a22) [0x5618e4aabcf2]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x58aa) [0x5618e4aafb7a]
E        --- /opt/ttforge-toolchain/venv/bin/python(+0x198be1) [0x5618e4acdbe1]

forge/forge/compile.py:785: RuntimeError

Check failure on line 59 in forge/test/models/pytorch/text/phi3/test_phi3.py

See this annotation in the file changed.

@github-actions github-actions / TT-Forge-FE Tests

test_phi3.test_phi3_causal_lm[no_device-microsoft/phi-3-mini-4k-instruct]

NotImplementedError: The following operators are not implemented: ['aten::bitwise_or_']
Raw output
variant = 'microsoft/phi-3-mini-4k-instruct', test_device = None

    @pytest.mark.nightly
    @pytest.mark.model_analysis
    @pytest.mark.parametrize("variant", variants)
    def test_phi3_causal_lm(variant, test_device):
    
        # Configurations
        compiler_cfg = forge.config._get_global_compiler_config()
        compiler_cfg.compile_depth = forge.CompileDepth.SPLIT_GRAPH
    
        # Phi3Config from pretrained variant, disable return_dict and caching.
        config = Phi3Config.from_pretrained(variant)
        config_dict = config.to_dict()
        config_dict["return_dict"] = False
        config_dict["use_cache"] = False
        config = Phi3Config(**config_dict)
    
        # Load tokenizer and model from HuggingFace
        tokenizer = AutoTokenizer.from_pretrained(variant, return_tensors="pt", trust_remote_code=True)
        tokenizer.add_special_tokens({"pad_token": "[PAD]"})
    
        model = Phi3ForCausalLM.from_pretrained(variant, trust_remote_code=True, config=config)
        model.eval()
    
        # input_prompt
        input_prompt = "Africa is an emerging economy because"
    
        # Tokenize input
        inputs = tokenizer(
            input_prompt,
            return_tensors="pt",
            max_length=256,
            pad_to_max_length=True,
            truncation=True,
        )
    
        input_ids = inputs["input_ids"]
        attn_mask = inputs["attention_mask"]
    
        inputs = [input_ids, attn_mask]
    
>       compiled_model = forge.compile(
            model, sample_inputs=inputs, module_name="pt_" + str(variant.split("/")[-1].replace("-", "_")) + "_causal_lm"
        )

forge/test/models/pytorch/text/phi3/test_phi3.py:59: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
forge/forge/compile.py:250: in compile_main
    return forge_compile_from_context(compile_context)
forge/forge/compile.py:292: in forge_compile_from_context
    next_stage = stage_to_func[current_stage](context)
forge/forge/compile.py:634: in generate_initial_graph
    module, module_inputs = convert_to_forge_module(
forge/forge/compile.py:973: in convert_to_forge_module
    forge_module, dev_types, module_inputs = generate_forge_module(
forge/forge/tvm_to_python.py:2076: in generate_forge_module
    module_writers, flattened_inputs = compile_tvm_to_python(
forge/forge/tvm_to_python.py:2168: in compile_tvm_to_python
    json_graphs, flattened_pytorch_inputs, weights = load_tvm_graph(
third_party/tvm/python/tvm/contrib/forge_compile.py:106: in load_tvm_graph
    json_graphs, flattened_inputs = compile_tvm_graph(inputs, module, compiler_cfg, graph_name=graph_name, input_names=input_names, path=path, verify_cfg=verify_cfg, framework=framework)
third_party/tvm/python/tvm/contrib/forge_compile.py:146: in compile_tvm_graph
    json_graphs, inputs = compile_pytorch_for_forge(module, *inputs, graph_name=graph_name, compiler_cfg=compiler_cfg, verify_cfg=verify_cfg, input_names=input_names)
third_party/tvm/python/tvm/contrib/forge_compile.py:372: in compile_pytorch_for_forge
    mod, params = tvm.relay.frontend.from_pytorch(traced_model, input_structure, do_convert_params=convert_params)
third_party/tvm/python/tvm/relay/frontend/pytorch.py:6077: in from_pytorch
    converter.report_missing_conversion(op_names)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <tvm.relay.frontend.pytorch.PyTorchOpConverter object at 0x7f18f02dea40>
op_names = {'aten::Int', 'aten::ScalarImplicit', 'aten::add', 'aten::add_', 'aten::arange', 'aten::bitwise_or_', ...}

    def report_missing_conversion(self, op_names):
        """Check if all ops in an input graph are supported by TVM"""
        known_ops = [
            "prim::Constant",
            "prim::GetAttr",
            "prim::ListConstruct",
            "prim::ListUnpack",
            "prim::TupleConstruct",
            "prim::TupleUnpack",
            "prim::RaiseException",
            "prim::If",
            "prim::Loop",
            "prim::DictConstruct",
            "prim::dtype",
            "prim::SetAttr",
            "prim::unchecked_cast"
        ]
        known_ops += list(self.convert_map.keys())
        known_ops += list(qnn_torch.convert_map.keys())
    
        missing = []
    
        for op_name in op_names:
            # Also take care of in-place variant ops like aten::relu_
            if op_name not in known_ops and not (
                op_name.endswith("_") and op_name[:-1] in known_ops
            ):
                missing.append(op_name)
    
        if missing:
            msg = f"The following operators are not implemented: {missing}"
>           raise NotImplementedError(msg)
E           NotImplementedError: The following operators are not implemented: ['aten::bitwise_or_']

third_party/tvm/python/tvm/relay/frontend/pytorch.py:4956: NotImplementedError

Check failure on line 41 in forge/test/models/pytorch/text/xglm/test_xglm.py

See this annotation in the file changed.

@github-actions github-actions / TT-Forge-FE Tests

test_xglm.test_xglm_causal_lm[no_device-facebook/xglm-1.7B]

RuntimeError: TT_ASSERT @ /__w/tt-forge-fe/tt-forge-fe/forge/csrc/passes/commute_utils.cpp:1105: reshape->op_name() == "reshape"
info:
update_reshape_attr called for a non-reshape operation
backtrace:
 --- tt::passes::update_reshape_attr(tt::graphlib::OpNode*, tt::graphlib::Shape)
 --- tt::passes::commute_and_bypass(tt::graphlib::Graph*, std::vector<tt::graphlib::Node*, std::allocator<tt::graphlib::Node*> > const&)
 --- tt::passes::erase_inverse_ops(tt::graphlib::Graph*)
 --- tt::run_optimization_graph_passes(tt::graphlib::Graph*)
 --- /__w/tt-forge-fe/tt-forge-fe/forge/forge/_C.so(+0xfc649) [0x7f1800a55649]
 --- /__w/tt-forge-fe/tt-forge-fe/forge/forge/_C.so(+0xdf905) [0x7f1800a38905]
 --- /opt/ttforge-toolchain/venv/bin/python(+0x18b282) [0x5618e4ac0282]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_MakeTpCall+0x25b) [0x5618e4ab6b4b]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x5c7d) [0x5618e4aaff4d]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x6d2) [0x5618e4aaa9a2]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x6d2) [0x5618e4aaa9a2]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x1a22) [0x5618e4aabcf2]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(PyObject_Call+0x122) [0x5618e4ace882]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2c89) [0x5618e4aacf59]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2c89) [0x5618e4aacf59]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x1a22) [0x5618e4aabcf2]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x58aa) [0x5618e4aafb7a]
 --- /opt/ttforge-toolchain/venv/bin/python(+0x198be1) [0x5618e4acdbe1]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x58aa) [0x5618e4aafb7a]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_FastCallDictTstate+0x16d) [0x5618e4ab5dbd]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_Call_Prepend+0x5c) [0x5618e4acad4c]
 --- /opt/ttforge-toolchain/venv/bin/python(+0x29e054) [0x5618e4bd3054]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_MakeTpCall+0x25b) [0x5618e4ab6b4b]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x671a) [0x5618e4ab09ea]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x818) [0x5618e4aaaae8]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2c89) [0x5618e4aacf59]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x1a22) [0x5618e4aabcf2]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x58aa) [0x5618e4aafb7a]
 --- /opt/ttforge-toolchain/venv/bin/python(+0x198be1) [0x5618e4acdbe1]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x58aa) [0x5618e4aafb7a]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_FastCallDictTstate+0x16d) [0x5618e4ab5dbd]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_Call_Prepend+0x5c) [0x5618e4acad4c]
 --- /opt/ttforge-toolchain/venv/bin/python(+0x29e054) [0x5618e4bd3054]
 --- /opt/ttforge-toolchain/venv/bin/python(PyObject_Call+0xbb) [0x5618e4ace81b]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2c89) [0x5618e4aacf59]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x6d2) [0x5618e4aaa9a2]
 --- /opt/ttforge-toolchain/venv/bin/python(+0x198be1) [0x5618e4acdbe1]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x1a22) [0x5618e4aabcf2]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2c89) [0x5618e4aacf59]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x6d2) [0x5618e4aaa9a2]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x1a22) [0x5618e4aabcf2]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2c89) [0x5618e4aacf59]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x1a22) [0x5618e4aabcf2]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x58aa) [0x5618e4aafb7a]
 --- /opt/ttforge-toolchain/venv/bin/python(+0x198be1) [0x5618e4acdbe1]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x58aa) [0x5618e4aafb7a]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_FastCallDictTstate+0x16d) [0x5618e4ab5dbd]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_Call_Prepend+0x5c) [0x5618e4acad4c]
 --- /opt/ttforge-toolchain/venv/bin/python(+0x29e054) [0x5618e4bd3054]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_MakeTpCall+0x25b) [0x5618e4ab6b4b]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x671a) [0x5618e4ab09ea]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2c89) [0x5618e4aacf59]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x1a22) [0x5618e4aabcf2]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x58aa) [0x5618e4aafb7a]
 --- /opt/ttforge-toolchain/venv/bin/python(+0x198be1) [0x5618e4acdbe1]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x58aa) [0x5618e4aafb7a]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_FastCallDictTstate+0x16d) [0x5618e4ab5dbd]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_Call_Prepend+0x5c) [0x5618e4acad4c]
 --- /opt/ttforge-toolchain/venv/bin/python(+0x29e054) [0x5618e4bd3054]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_MakeTpCall+0x25b) [0x5618e4ab6b4b]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x671a) [0x5618e4ab09ea]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x6d2) [0x5618e4aaa9a2]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x6d2) [0x5618e4aaa9a2]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2c89) [0x5618e4aacf59]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x1a22) [0x5618e4aabcf2]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
 --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x58aa) [0x5618e4aafb7a]
 --- /opt/ttforge-toolchain/venv/bin/python(+0x198be1) [0x5618e4acdbe1]
Raw output
variant = 'facebook/xglm-1.7B', test_device = None

    @pytest.mark.nightly
    @pytest.mark.model_analysis
    @pytest.mark.parametrize("variant", variants, ids=variants)
    def test_xglm_causal_lm(variant, test_device):
        # Set Forge configuration parameters
        compiler_cfg = forge.config._get_global_compiler_config()
        compiler_cfg.compile_depth = forge.CompileDepth.SPLIT_GRAPH
    
        config = XGLMConfig.from_pretrained(variant)
        config_dict = config.to_dict()
        config_dict["return_dict"] = False
        config_dict["use_cache"] = False
        config = XGLMConfig(**config_dict)
        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"]]
>       compiled_model = forge.compile(
            model, sample_inputs=inputs, module_name="pt_" + str(variant.split("/")[-1].replace("-", "_").replace(".", "_"))
        )

forge/test/models/pytorch/text/xglm/test_xglm.py:41: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
forge/forge/compile.py:250: in compile_main
    return forge_compile_from_context(compile_context)
forge/forge/compile.py:292: in forge_compile_from_context
    next_stage = stage_to_func[current_stage](context)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

context = CompileContext(modules=[Module pt_xglm_1_7B], graph_name='pt_xglm_1_7B', compiler_cfg=CompilerConfig(enable_training=F...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/passes/commute_utils.cpp:1105: reshape->op_name() == "reshape"
E       info:
E       update_reshape_attr called for a non-reshape operation
E       backtrace:
E        --- tt::passes::update_reshape_attr(tt::graphlib::OpNode*, tt::graphlib::Shape)
E        --- tt::passes::commute_and_bypass(tt::graphlib::Graph*, std::vector<tt::graphlib::Node*, std::allocator<tt::graphlib::Node*> > const&)
E        --- tt::passes::erase_inverse_ops(tt::graphlib::Graph*)
E        --- tt::run_optimization_graph_passes(tt::graphlib::Graph*)
E        --- /__w/tt-forge-fe/tt-forge-fe/forge/forge/_C.so(+0xfc649) [0x7f1800a55649]
E        --- /__w/tt-forge-fe/tt-forge-fe/forge/forge/_C.so(+0xdf905) [0x7f1800a38905]
E        --- /opt/ttforge-toolchain/venv/bin/python(+0x18b282) [0x5618e4ac0282]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_MakeTpCall+0x25b) [0x5618e4ab6b4b]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x5c7d) [0x5618e4aaff4d]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x6d2) [0x5618e4aaa9a2]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x6d2) [0x5618e4aaa9a2]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x1a22) [0x5618e4aabcf2]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(PyObject_Call+0x122) [0x5618e4ace882]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2c89) [0x5618e4aacf59]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2c89) [0x5618e4aacf59]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x1a22) [0x5618e4aabcf2]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x58aa) [0x5618e4aafb7a]
E        --- /opt/ttforge-toolchain/venv/bin/python(+0x198be1) [0x5618e4acdbe1]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x58aa) [0x5618e4aafb7a]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_FastCallDictTstate+0x16d) [0x5618e4ab5dbd]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_Call_Prepend+0x5c) [0x5618e4acad4c]
E        --- /opt/ttforge-toolchain/venv/bin/python(+0x29e054) [0x5618e4bd3054]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_MakeTpCall+0x25b) [0x5618e4ab6b4b]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x671a) [0x5618e4ab09ea]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x818) [0x5618e4aaaae8]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2c89) [0x5618e4aacf59]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x1a22) [0x5618e4aabcf2]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x58aa) [0x5618e4aafb7a]
E        --- /opt/ttforge-toolchain/venv/bin/python(+0x198be1) [0x5618e4acdbe1]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x58aa) [0x5618e4aafb7a]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_FastCallDictTstate+0x16d) [0x5618e4ab5dbd]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_Call_Prepend+0x5c) [0x5618e4acad4c]
E        --- /opt/ttforge-toolchain/venv/bin/python(+0x29e054) [0x5618e4bd3054]
E        --- /opt/ttforge-toolchain/venv/bin/python(PyObject_Call+0xbb) [0x5618e4ace81b]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2c89) [0x5618e4aacf59]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x6d2) [0x5618e4aaa9a2]
E        --- /opt/ttforge-toolchain/venv/bin/python(+0x198be1) [0x5618e4acdbe1]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x1a22) [0x5618e4aabcf2]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2c89) [0x5618e4aacf59]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x6d2) [0x5618e4aaa9a2]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x1a22) [0x5618e4aabcf2]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2c89) [0x5618e4aacf59]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x1a22) [0x5618e4aabcf2]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x58aa) [0x5618e4aafb7a]
E        --- /opt/ttforge-toolchain/venv/bin/python(+0x198be1) [0x5618e4acdbe1]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x58aa) [0x5618e4aafb7a]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_FastCallDictTstate+0x16d) [0x5618e4ab5dbd]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_Call_Prepend+0x5c) [0x5618e4acad4c]
E        --- /opt/ttforge-toolchain/venv/bin/python(+0x29e054) [0x5618e4bd3054]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_MakeTpCall+0x25b) [0x5618e4ab6b4b]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x671a) [0x5618e4ab09ea]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2c89) [0x5618e4aacf59]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x1a22) [0x5618e4aabcf2]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x58aa) [0x5618e4aafb7a]
E        --- /opt/ttforge-toolchain/venv/bin/python(+0x198be1) [0x5618e4acdbe1]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x58aa) [0x5618e4aafb7a]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_FastCallDictTstate+0x16d) [0x5618e4ab5dbd]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_Call_Prepend+0x5c) [0x5618e4acad4c]
E        --- /opt/ttforge-toolchain/venv/bin/python(+0x29e054) [0x5618e4bd3054]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_MakeTpCall+0x25b) [0x5618e4ab6b4b]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x671a) [0x5618e4ab09ea]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x6d2) [0x5618e4aaa9a2]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x6d2) [0x5618e4aaa9a2]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2c89) [0x5618e4aacf59]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x1a22) [0x5618e4aabcf2]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x5618e4ac0aec]
E        --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x58aa) [0x5618e4aafb7a]
E        --- /opt/ttforge-toolchain/venv/bin/python(+0x198be1) [0x5618e4acdbe1]

forge/forge/compile.py:785: RuntimeError

Check failure on line 38 in forge/test/models/pytorch/timeseries/nbeats/test_nbeats.py

See this annotation in the file changed.

@github-actions github-actions / TT-Forge-FE Tests

test_nbeats.test_nbeats_with_seasonality_basis[no_device]

RuntimeError: Tensor 4 - stride mismatch: expected [24, 1], got [1, 12]
Raw output
test_device = None

    @pytest.mark.nightly
    @pytest.mark.model_analysis
    # @pytest.mark.xfail(reason="Failing with pcc=0.82")
    def test_nbeats_with_seasonality_basis(test_device):
        compiler_cfg = forge.config._get_global_compiler_config()
    
        x, x_mask = get_electricity_dataset_input()
    
        pytorch_model = NBeatsWithSeasonalityBasis(
            input_size=72,
            output_size=24,
            num_of_harmonics=1,
            stacks=30,
            layers=4,
            layer_size=2048,
        )
        pytorch_model.eval()
        compiled_model = forge.compile(pytorch_model, sample_inputs=[x, x_mask], module_name="nbeats_seasonality")
        inputs = [x, x_mask]
>       co_out = compiled_model(*inputs)

forge/test/models/pytorch/timeseries/nbeats/test_nbeats.py:38: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <forge.compiled_graph_state.CompiledModel object at 0x7f18394a7340>
inputs = (tensor([[[[ 160.50679,  156.32184,  146.39499,  ...,  264.03345,  169.91641,  163.64682],
          [  79.53951,   85...[1., 1., 1.,  ..., 1., 1., 1.],
          [1., 1., 1.,  ..., 1., 1., 1.],
          [1., 1., 1.,  ..., 1., 1., 1.]]]]))
inputs_and_parameters = [tensor([[[[ 160.50679,  156.32184,  146.39499,  ...,  264.03345,  169.91641,  163.64682],
          [  79.53951,   85...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.]]), ...]

    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 = [*inputs]
        inputs_and_parameters = [
            *inputs,
            *self.fwd_compiled_graph_state.get_ordered_constant_tensors(),
            *self.fwd_compiled_graph_state.get_ordered_parameter_tensors(),
        ]
    
        if any([not isinstance(t, torch.Tensor) for t in inputs_and_parameters]):
            logger.info("Converting inputs and parameters to PyTorch tensors...")
            inputs_and_parameters = to_pt_tensors(inputs_and_parameters)
    
        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 4 - stride mismatch: expected [24, 1], got [1, 12]

forge/forge/compiled_graph_state.py:273: RuntimeError

Check failure on line 104 in forge/test/models/pytorch/vision/vovnet/test_vovnet.py

See this annotation in the file changed.

@github-actions github-actions / TT-Forge-FE Tests

test_vovnet.test_vovnet_timm_pytorch[no_device-ese_vovnet39b]

AssertionError: Eltwise binary ops must have the same shape in both inputs, or one operand must be 1 wide to broadcast: [1, 1, 7, 7168] vs [1, 1, 7, 7]
Raw output
variant = 'ese_vovnet39b', test_device = None

    @pytest.mark.nightly
    @pytest.mark.model_analysis
    @pytest.mark.parametrize("variant", variants, ids=variants)
    def test_vovnet_timm_pytorch(variant, test_device):
        model, inputs, _ = generate_model_vovnet_imgcls_timm_pytorch(
            test_device,
            variant,
        )
>       compiled_model = forge.compile(model, sample_inputs=[inputs[0]], module_name=f"pt_{variant}")

forge/test/models/pytorch/vision/vovnet/test_vovnet.py:104: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
forge/forge/compile.py:250: in compile_main
    return forge_compile_from_context(compile_context)
forge/forge/compile.py:292: in forge_compile_from_context
    next_stage = stage_to_func[current_stage](context)
forge/forge/compile.py:785: in run_optimization_pass
    run_optimization_graph_passes(graph)
forge/forge/op/eval/forge/__init__.py:217: in <lambda>
    return lambda *inputs: module_or_class.shape(op_type.op, op_type.attr, *inputs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

type = 'multiply', attr = [], ops = [[1, 1, 7, 7168], [1, 1, 7, 7]]

    def shape(type, attr, ops) -> Tuple[Tuple, List]:
        assert len(ops) == 2, "Eltwise binary should have two inputs"
    
        if type == "binary_stack":
            dim = attr[0]
            assert ops[0] == ops[1]
            output_shape = list(ops[0])
            output_shape[dim] *= 2
            return tuple(output_shape), []
    
        assert len(attr) == 0, "Eltwise binary should have no attributes"
    
        broadcast = []
        output_shape = []
    
        ops[0] = list(ops[0])
        while len(ops[0]) < len(ops[1]):
            ops[0] = [1] + ops[0]
    
        ops[1] = list(ops[1])
        while len(ops[1]) < len(ops[0]):
            ops[1] = [1] + ops[1]
    
        for dim in range(len(ops[0])):
            if ops[0][dim] != ops[1][dim]:
                if ops[1][dim] == 1:
                    broadcast.append((1, dim - len(ops[1]), ops[0][dim]))  # Convert to negative indexing
                    output_shape.append(ops[0][dim])
                else:
                    assert (
>                       ops[0][dim] == 1
                    ), f"Eltwise binary ops must have the same shape in both inputs, or one operand must be 1 wide to broadcast: {ops[0]} vs {ops[1]}"
E                   AssertionError: Eltwise binary ops must have the same shape in both inputs, or one operand must be 1 wide to broadcast: [1, 1, 7, 7168] vs [1, 1, 7, 7]

forge/forge/op/eval/forge/eltwise_binary.py:91: AssertionError