Code cleanup in pytorch models (#1103) #450
82 tests run, 9 passed, 57 skipped, 16 failed.
Annotations
Check failure on line 81 in forge/test/models/pytorch/audio/whisper/test_whisper.py
github-actions / TT-Forge-FE Tests
test_whisper.test_whisper[openai/whisper-tiny]
AssertionError: Eltwise binary ops must have the same shape in both inputs, or one operand must be 1 wide to broadcast: [1, 3000, 1, 384] vs [1, 384, 3000, 1]
Raw output
record_forge_property = <function record_property.<locals>.append_property at 0x7fe467a948b0>
variant = 'openai/whisper-tiny'
@pytest.mark.nightly
@pytest.mark.parametrize("variant", variants, ids=variants)
def test_whisper(record_forge_property, variant):
if variant != "openai/whisper-tiny":
pytest.skip("Skipping due to the current CI/CD pipeline limitations")
# Build Module Name
module_name = build_module_name(
framework=Framework.PYTORCH,
model="whisper",
variant=variant,
task=Task.SPEECH_RECOGNITION,
source=Source.HUGGINGFACE,
)
# Record Forge Property
record_forge_property("model_name", module_name)
# Load model (with tokenizer and feature extractor)
processor = download_model(AutoProcessor.from_pretrained, variant)
model_config = WhisperConfig.from_pretrained(variant)
model = download_model(
WhisperForConditionalGeneration.from_pretrained,
variant,
config=model_config,
)
model.config.use_cache = False
# Load and preprocess sample audio
sample = torch.load("forge/test/models/files/samples/audio/1272-128104-0000.pt")
sample_audio = sample["audio"]["array"]
inputs = processor(sample_audio, return_tensors="pt")
input_features = inputs.input_features
# Get decoder inputs
decoder_start_token_tensor = torch.tensor(model.generation_config.decoder_start_token_id, dtype=torch.long)
decoder_input_ids = torch.ones((1, 1), dtype=torch.long) * decoder_start_token_tensor
inputs = [input_features, decoder_input_ids]
class Wrapper(torch.nn.Module):
def __init__(self, model):
super().__init__()
self.model = model
def forward(self, input_features, decoder_input_ids):
inputs = {"input_features": input_features, "decoder_input_ids": decoder_input_ids}
output = self.model(**inputs)
return output.logits
framework_model = Wrapper(model)
# Forge compile framework model
> compiled_model = forge.compile(framework_model, sample_inputs=inputs, module_name=module_name)
forge/test/models/pytorch/audio/whisper/test_whisper.py:81:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
forge/forge/compile.py:253: in compile_main
return forge_compile_from_context(compile_context)
forge/forge/compile.py:295: in forge_compile_from_context
next_stage = stage_to_func[current_stage](context)
forge/forge/compile.py:829: in run_optimization_pass
run_optimization_graph_passes(graph)
forge/forge/op/eval/forge/__init__.py:218: in <lambda>
return lambda *inputs: module_or_class.shape(op_type.op, op_type.attr, *inputs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
type = 'add', attr = [], ops = [[1, 3000, 1, 384], [1, 384, 3000, 1]]
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, 3000, 1, 384] vs [1, 384, 3000, 1]
forge/forge/op/eval/forge/eltwise_binary.py:91: AssertionError
Check failure on line 69 in forge/test/models/pytorch/text/bart/test_bart.py
github-actions / TT-Forge-FE Tests
test_bart.test_pt_bart_classifier[facebook/bart-large-mnli]
RuntimeError: TT_THROW @ /__w/tt-forge-fe/tt-forge-fe/third_party/tt-mlir/third_party/tt-metal/src/tt-metal/tt_metal/impl/kernels/kernel.cpp:241: tt::exception
info:
1283 unique+common runtime args targeting kernel reader_concat_stick_layout_interleaved_start_id on (x=0,y=0) are too large. Max allowable is 256
backtrace:
--- /__w/tt-forge-fe/tt-forge-fe/third_party/tt-mlir/third_party/tt-metal/src/tt-metal-build/lib/libtt_metal.so(+0x132015) [0x7fe4a17fc015]
--- tt::tt_metal::v0::Kernel::validate_runtime_args_size(unsigned long, unsigned long, tt::umd::xy_pair const&)
--- tt::tt_metal::v0::Kernel::set_runtime_args(tt::umd::xy_pair const&, tt::stl::Span<unsigned int const, 18446744073709551615ul>)
--- /__w/tt-forge-fe/tt-forge-fe/third_party/tt-mlir/third_party/tt-metal/src/tt-metal-build/lib/libtt_metal.so(+0x2d1693) [0x7fe4a199b693]
--- tt::tt_metal::v0::SetRuntimeArgs(tt::tt_metal::v0::Program const&, unsigned int, std::variant<tt::umd::xy_pair, CoreRange, CoreRangeSet> const&, tt::stl::Span<unsigned int const, 18446744073709551615ul>)
--- ttnn::operations::data_movement::detail::concat_multi_core(std::vector<tt::tt_metal::Tensor, std::allocator<tt::tt_metal::Tensor> > const&, unsigned int, tt::tt_metal::Tensor const&)
--- /__w/tt-forge-fe/tt-forge-fe/third_party/tt-mlir/third_party/tt-metal/src/tt-metal-build/lib/_ttnn.so(+0x6ccd83) [0x7fe4a2143d83]
--- /__w/tt-forge-fe/tt-forge-fe/third_party/tt-mlir/third_party/tt-metal/src/tt-metal-build/lib/_ttnn.so(+0x3081caa) [0x7fe4a4af8caa]
--- /__w/tt-forge-fe/tt-forge-fe/third_party/tt-mlir/third_party/tt-metal/src/tt-metal-build/lib/_ttnn.so(+0x30820b4) [0x7fe4a4af90b4]
--- void ttnn::device_operation::detail::launch_on_worker_thread<tt::tt_metal::operation::OldInfraDeviceOperation<std::vector<tt::tt_metal::Tensor, std::allocator<tt::tt_metal::Tensor> > >, unsigned char, long, tt::tt_metal::operation::DeviceOperation<std::vector<tt::tt_metal::Tensor, std::allocator<tt::tt_metal::Tensor> > >, tt::tt_metal::operation::OldInfraDeviceOperation<std::vector<tt::tt_metal::Tensor, std::allocator<tt::tt_metal::Tensor> > >::tensor_args_t, std::vector<tt::tt_metal::Tensor, std::allocator<tt::tt_metal::Tensor> >, tt::tt_metal::v0::IDevice*>(unsigned char, long, tt::tt_metal::operation::DeviceOperation<std::vector<tt::tt_metal::Tensor, std::allocator<tt::tt_metal::Tensor> > > const&, tt::tt_metal::operation::OldInfraDeviceOperation<std::vector<tt::tt_metal::Tensor, std::allocator<tt::tt_metal::Tensor> > >::tensor_args_t const&, std::vector<tt::tt_metal::Tensor, std::allocator<tt::tt_metal::Tensor> >&, tt::tt_metal::v0::IDevice*&)
--- tt::tt_metal::operation::OldInfraDeviceOperation<std::vector<tt::tt_metal::Tensor, std::allocator<tt::tt_metal::Tensor> > >::tensor_return_value_t ttnn::device_operation::detail::launch_on_single_device<tt::tt_metal::operation::OldInfraDeviceOperation<std::vector<tt::tt_metal::Tensor, std::allocator<tt::tt_metal::Tensor> > > >(unsigned char, tt::tt_metal::operation::OldInfraDeviceOperation<std::vector<tt::tt_metal::Tensor, std::allocator<tt::tt_metal::Tensor> > >::operation_attributes_t const&, tt::tt_metal::operation::OldInfraDeviceOperation<std::vector<tt::tt_metal::Tensor, std::allocator<tt::tt_metal::Tensor> > >::tensor_args_t const&)
--- /__w/tt-forge-fe/tt-forge-fe/third_party/tt-mlir/third_party/tt-metal/src/tt-metal-build/lib/_ttnn.so(+0x3080fa9) [0x7fe4a4af7fa9]
--- tt::tt_metal::operation::OldInfraDeviceOperation<std::vector<tt::tt_metal::Tensor, std::allocator<tt::tt_metal::Tensor> > >::tensor_return_value_t ttnn::device_operation::detail::invoke<tt::tt_metal::operation::OldInfraDeviceOperation<std::vector<tt::tt_metal::Tensor, std::allocator<tt::tt_metal::Tensor> > > >(unsigned char, tt::tt_metal::operation::OldInfraDeviceOperation<std::vector<tt::tt_metal::Tensor, std::allocator<tt::tt_metal::Tensor> > >::operation_attributes_t const&, tt::tt_metal::operation::OldInfraDeviceOperation<std::vector<tt::tt_metal::Tensor, std::allocator<tt::tt_metal::Tensor> > >::tensor_args_t const&)
--- /__w/tt-forge-fe/tt-forge-fe/third_party/tt-mlir/third_party/tt-metal/src/tt-metal-build/lib/_ttnn.so(+0x307d6ef) [0x7fe4a4af46ef]
--- /__w/tt-forge-fe/tt-forge-fe/third_party/tt-mlir/third_party/tt-metal/src/tt-metal-build/lib/_ttnn.so(_ZN2tt8tt_metal9operation19run_with_autoformatEONS1_15DeviceOperationISt6vectorINS0_6TensorESaIS4_EEEERKS6_RKS3_IN4ttnn10operations12experimental11auto_format12FormatParamsESaISF_EERKS3_INS0_6LayoutESaISK_EERKS3_ISt8optionalIKS4_ESaISR_EERKS3_ISP_ISF_ESaISW_EERKS3_ISP_IS4_ESaIS11_EEh+0x503) [0x7fe4a4af1603]
--- /__w/tt-forge-fe/tt-forge-fe/third_party/tt-mlir/third_party/tt-metal/src/tt-metal-build/lib/_ttnn.so(+0x6cbf69) [0x7fe4a2142f69]
--- /__w/tt-forge-fe/tt-forge-fe/third_party/tt-mlir/third_party/tt-metal/src/tt-metal-build/lib/_ttnn.so(+0x6ce96b) [0x7fe4a214596b]
--- /__w/tt-forge-fe/tt-forge-fe/third_party/tt-mlir/third_party/tt-metal/src/tt-metal-build/lib/_ttnn.so(+0x6cf51c) [0x7fe4a214651c]
--- ttnn::operations::data_movement::concat_impl(std::vector<tt::tt_metal::Tensor, std::allocator<tt::tt_metal::Tensor> > const&, long, unsigned int, tt::tt_metal::MemoryConfig const&)
--- /__w/tt-forge-fe/tt-forge-fe/third_party/tt-mlir/third_party/tt-metal/src/tt-metal-build/lib/_ttnn.so(+0x6c660b) [0x7fe4a213d60b]
--- /__w/tt-forge-fe/tt-forge-fe/third_party/tt-mlir/third_party/tt-metal/src/tt-metal-build/lib/_ttnn.so(+0x692d65) [0x7fe4a2109d65]
--- ttnn::operations::data_movement::ConcatOperation::invoke(unsigned char, std::vector<tt::tt_metal::Tensor, std::allocator<tt::tt_metal::Tensor> > const&, int, std::optional<tt::tt_metal::MemoryConfig> const&, std::optional<tt::tt_metal::Tensor> const&, unsigned int)
--- ttnn::operations::data_movement::ConcatOperation::invoke(std::vector<tt::tt_metal::Tensor, std::allocator<tt::tt_metal::Tensor> > const&, int, std::optional<tt::tt_metal::MemoryConfig> const&, std::optional<tt::tt_metal::Tensor> const&, unsigned int)
--- /__w/tt-forge-fe/tt-forge-fe/third_party/tt-mlir/third_party/tt-metal/src/tt-metal-build/lib/_ttnn.so(+0x6064e1) [0x7fe4a207d4e1]
--- /__w/tt-forge-fe/tt-forge-fe/third_party/tt-mlir/third_party/tt-metal/src/tt-metal-build/lib/_ttnn.so(+0x6047cf) [0x7fe4a207b7cf]
--- /__w/tt-forge-fe/tt-forge-fe/third_party/tt-mlir/third_party/tt-metal/src/tt-metal-build/lib/_ttnn.so(+0x60430c) [0x7fe4a207b30c]
--- /__w/tt-forge-fe/tt-forge-fe/third_party/tt-mlir/third_party/tt-metal/src/tt-metal-build/lib/_ttnn.so(+0x5ead11) [0x7fe4a2061d11]
--- ttnn::operations::data_movement::ExecuteRepeatInterleave::invoke(tt::tt_metal::Tensor const&, unsigned int, int, std::optional<tt::tt_metal::MemoryConfig> const&)
--- /__w/tt-forge-fe/tt-forge-fe/third_party/tt-mlir/build/lib/SharedLib/libTTMLIR.so(+0x797067) [0x7fe4a66f5067]
--- /__w/tt-forge-fe/tt-forge-fe/third_party/tt-mlir/build/lib/SharedLib/libTTMLIR.so(+0x797ba0) [0x7fe4a66f5ba0]
--- /__w/tt-forge-fe/tt-forge-fe/third_party/tt-mlir/build/lib/SharedLib/libTTMLIR.so(+0x7984b1) [0x7fe4a66f64b1]
--- /__w/tt-forge-fe/tt-forge-fe/third_party/tt-mlir/build/lib/SharedLib/libTTMLIR.so(+0x79604f) [0x7fe4a66f404f]
--- /__w/tt-forge-fe/tt-forge-fe/third_party/tt-mlir/build/lib/SharedLib/libTTMLIR.so(+0x79483c) [0x7fe4a66f283c]
--- /__w/tt-forge-fe/tt-forge-fe/third_party/tt-mlir/build/lib/SharedLib/libTTMLIR.so(+0x794317) [0x7fe4a66f2317]
--- tt::runtime::ttnn::operations::data_movement::run(tt::target::ttnn::RepeatInterleaveOp const*, tt::runtime::ttnn::ProgramContext&)
--- tt::runtime::ttnn::runProgram(tt::tt_metal::distributed::MeshDevice&, tt::runtime::Binary, unsigned int, std::vector<tt::tt_metal::Tensor*, std::allocator<tt::tt_metal::Tensor*> > const&)
--- tt::runtime::ttnn::submit(tt::runtime::Device, tt::runtime::Binary, unsigned int, std::vector<tt::runtime::Tensor, std::allocator<tt::runtime::Tensor> > const&)
--- tt::runtime::submit(tt::runtime::Device, tt::runtime::Binary, unsigned int, std::vector<tt::runtime::Tensor, std::allocator<tt::runtime::Tensor> > const&)
--- tt::run_binary(tt::runtime::Binary&, int, std::vector<at::Tensor, std::allocator<at::Tensor> > const&)
--- /__w/tt-forge-fe/tt-forge-fe/forge/forge/_C.so(+0x3174e0) [0x7fe4b2e464e0]
--- /__w/tt-forge-fe/tt-forge-fe/forge/forge/_C.so(+0x31742e) [0x7fe4b2e4642e]
--- /__w/tt-forge-fe/tt-forge-fe/forge/forge/_C.so(+0xe0cf5) [0x7fe4b2c0fcf5]
--- /opt/ttforge-toolchain/venv/bin/python(+0x18ab32) [0x55ef57fe0b32]
--- /opt/ttforge-toolchain/venv/bin/python(_PyObject_MakeTpCall+0x25b) [0x55ef57fd739b]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x59c7) [0x55ef57fd0a97]
--- /opt/ttforge-toolchain/venv/bin/python(_PyObject_FastCallDictTstate+0xc4) [0x55ef57fd6574]
--- /opt/ttforge-toolchain/venv/bin/python(_PyObject_Call_Prepend+0x5c) [0x55ef57feb62c]
--- /opt/ttforge-toolchain/venv/bin/python(+0x29d464) [0x55ef580f3464]
--- /opt/ttforge-toolchain/venv/bin/python(PyObject_Call+0xbb) [0x55ef57fef10b]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2b60) [0x55ef57fcdc30]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x6c0) [0x55ef57fcb790]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
--- /opt/ttforge-toolchain/venv/bin/python(PyObject_Call+0x122) [0x55ef57fef172]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2b60) [0x55ef57fcdc30]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2b60) [0x55ef57fcdc30]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x18db) [0x55ef57fcc9ab]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x5632) [0x55ef57fd0702]
--- /opt/ttforge-toolchain/venv/bin/python(+0x1984d1) [0x55ef57fee4d1]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x5632) [0x55ef57fd0702]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyObject_FastCallDictTstate+0x16d) [0x55ef57fd661d]
--- /opt/ttforge-toolchain/venv/bin/python(_PyObject_Call_Prepend+0x5c) [0x55ef57feb62c]
--- /opt/ttforge-toolchain/venv/bin/python(+0x29d464) [0x55ef580f3464]
--- /opt/ttforge-toolchain/venv/bin/python(_PyObject_MakeTpCall+0x25b) [0x55ef57fd739b]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x68ce) [0x55ef57fd199e]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x8af) [0x55ef57fcb97f]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2b60) [0x55ef57fcdc30]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x18db) [0x55ef57fcc9ab]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x5632) [0x55ef57fd0702]
--- /opt/ttforge-toolchain/venv/bin/python(+0x1984d1) [0x55ef57fee4d1]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x5632) [0x55ef57fd0702]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyObject_FastCallDictTstate+0x16d) [0x55ef57fd661d]
--- /opt/ttforge-toolchain/venv/bin/python(_PyObject_Call_Prepend+0x5c) [0x55ef57feb62c]
--- /opt/ttforge-toolchain/venv/bin/python(+0x29d464) [0x55ef580f3464]
--- /opt/ttforge-toolchain/venv/bin/python(PyObject_Call+0xbb) [0x55ef57fef10b]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2b60) [0x55ef57fcdc30]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x6c0) [0x55ef57fcb790]
--- /opt/ttforge-toolchain/venv/bin/python(+0x1984d1) [0x55ef57fee4d1]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x18db) [0x55ef57fcc9ab]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2b60) [0x55ef57fcdc30]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x6c0) [0x55ef57fcb790]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x18db) [0x55ef57fcc9ab]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2b60) [0x55ef57fcdc30]
Raw output
record_forge_property = <function record_property.<locals>.append_property at 0x7fe54cc609d0>
variant = 'facebook/bart-large-mnli'
@pytest.mark.nightly
@pytest.mark.parametrize("variant", ["facebook/bart-large-mnli"])
def test_pt_bart_classifier(record_forge_property, variant):
# Build Module Name
module_name = build_module_name(
framework=Framework.PYTORCH,
model="bart",
variant=variant,
task=Task.SEQUENCE_CLASSIFICATION,
source=Source.HUGGINGFACE,
)
# Record Forge Property
record_forge_property("model_name", module_name)
model = download_model(BartForSequenceClassification.from_pretrained, variant, torchscript=True)
tokenizer = download_model(BartTokenizer.from_pretrained, variant, 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
framework_model = BartWrapper(model.model)
# Forge compile framework model
compiled_model = forge.compile(framework_model, sample_inputs=inputs, module_name=module_name)
# Model Verification
> verify(inputs, framework_model, compiled_model)
forge/test/models/pytorch/text/bart/test_bart.py:69:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
forge/forge/verify/verify.py:302: in verify
co_out = compiled_model(*inputs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <forge.compiled_graph_state.CompiledModel object at 0x7fe54bb85420>
inputs = (tensor([[ 0, 15117, 8267, 4349, 1302, 7, 28, 5, 129, 97, 931, 1312, 519, 143, 11857, 197... 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]]))
inputs_and_parameters = [tensor([[ 0, 15117, 8267, 4349, 1302, 7, 28, 5, 129, 97, 931, 1312, 519, 143, 11857, 197... [1.00000e-05],
[1.00000e-05],
[1.00000e-05],
[1.00000e-05],
[1.00000e-05]]]), ...]
def __call__(self, *inputs: AnyTensor) -> List[torch.Tensor]:
"""
Run inference on the compiled model.
Parameters
----------
inputs: [Tensor, ...]
Input tensors
Returns
-------
List[Tensor]
Output tensors
"""
self.inputs = [*to_pt_tensors(inputs)]
inputs_and_parameters = [
*self.inputs,
*self.fwd_compiled_graph_state.get_ordered_constant_tensors(),
*self.fwd_compiled_graph_state.get_ordered_parameter_tensors(),
]
assert all(
[isinstance(t, torch.Tensor) for t in inputs_and_parameters]
), "All inputs should be torch tensors by now."
if self.training() and isinstance(self.framework_module, PyTorchModule):
for name, param in self.framework_module.module.named_parameters():
if param.requires_grad:
our_tensor = self.fwd_compiled_graph_state.get_parameter_tensor(name)
# NOTE: for parameters that require gradients, we want to share the same tensor with the PyTorch
# module. This is because we want to be able to optimize the parameters both on the device
# (through our runtime) and via the torch optimizers. So this ensures that whichever side updates
# the parameter value, the other side can see the change.
#
# This could change in the future, but for now ensure that our premise is correct.
assert param is our_tensor
logger.info(
f"Running model {self.framework_module.get_name()} {self.fwd_compiled_graph_state.graph.get_name()} on device..."
)
> all_outputs = run_binary(self.compiled_binary, int(ProgramId.FORWARD), inputs_and_parameters)
E RuntimeError: TT_THROW @ /__w/tt-forge-fe/tt-forge-fe/third_party/tt-mlir/third_party/tt-metal/src/tt-metal/tt_metal/impl/kernels/kernel.cpp:241: tt::exception
E info:
E 1283 unique+common runtime args targeting kernel reader_concat_stick_layout_interleaved_start_id on (x=0,y=0) are too large. Max allowable is 256
E backtrace:
E --- /__w/tt-forge-fe/tt-forge-fe/third_party/tt-mlir/third_party/tt-metal/src/tt-metal-build/lib/libtt_metal.so(+0x132015) [0x7fe4a17fc015]
E --- tt::tt_metal::v0::Kernel::validate_runtime_args_size(unsigned long, unsigned long, tt::umd::xy_pair const&)
E --- tt::tt_metal::v0::Kernel::set_runtime_args(tt::umd::xy_pair const&, tt::stl::Span<unsigned int const, 18446744073709551615ul>)
E --- /__w/tt-forge-fe/tt-forge-fe/third_party/tt-mlir/third_party/tt-metal/src/tt-metal-build/lib/libtt_metal.so(+0x2d1693) [0x7fe4a199b693]
E --- tt::tt_metal::v0::SetRuntimeArgs(tt::tt_metal::v0::Program const&, unsigned int, std::variant<tt::umd::xy_pair, CoreRange, CoreRangeSet> const&, tt::stl::Span<unsigned int const, 18446744073709551615ul>)
E --- ttnn::operations::data_movement::detail::concat_multi_core(std::vector<tt::tt_metal::Tensor, std::allocator<tt::tt_metal::Tensor> > const&, unsigned int, tt::tt_metal::Tensor const&)
E --- /__w/tt-forge-fe/tt-forge-fe/third_party/tt-mlir/third_party/tt-metal/src/tt-metal-build/lib/_ttnn.so(+0x6ccd83) [0x7fe4a2143d83]
E --- /__w/tt-forge-fe/tt-forge-fe/third_party/tt-mlir/third_party/tt-metal/src/tt-metal-build/lib/_ttnn.so(+0x3081caa) [0x7fe4a4af8caa]
E --- /__w/tt-forge-fe/tt-forge-fe/third_party/tt-mlir/third_party/tt-metal/src/tt-metal-build/lib/_ttnn.so(+0x30820b4) [0x7fe4a4af90b4]
E --- void ttnn::device_operation::detail::launch_on_worker_thread<tt::tt_metal::operation::OldInfraDeviceOperation<std::vector<tt::tt_metal::Tensor, std::allocator<tt::tt_metal::Tensor> > >, unsigned char, long, tt::tt_metal::operation::DeviceOperation<std::vector<tt::tt_metal::Tensor, std::allocator<tt::tt_metal::Tensor> > >, tt::tt_metal::operation::OldInfraDeviceOperation<std::vector<tt::tt_metal::Tensor, std::allocator<tt::tt_metal::Tensor> > >::tensor_args_t, std::vector<tt::tt_metal::Tensor, std::allocator<tt::tt_metal::Tensor> >, tt::tt_metal::v0::IDevice*>(unsigned char, long, tt::tt_metal::operation::DeviceOperation<std::vector<tt::tt_metal::Tensor, std::allocator<tt::tt_metal::Tensor> > > const&, tt::tt_metal::operation::OldInfraDeviceOperation<std::vector<tt::tt_metal::Tensor, std::allocator<tt::tt_metal::Tensor> > >::tensor_args_t const&, std::vector<tt::tt_metal::Tensor, std::allocator<tt::tt_metal::Tensor> >&, tt::tt_metal::v0::IDevice*&)
E --- tt::tt_metal::operation::OldInfraDeviceOperation<std::vector<tt::tt_metal::Tensor, std::allocator<tt::tt_metal::Tensor> > >::tensor_return_value_t ttnn::device_operation::detail::launch_on_single_device<tt::tt_metal::operation::OldInfraDeviceOperation<std::vector<tt::tt_metal::Tensor, std::allocator<tt::tt_metal::Tensor> > > >(unsigned char, tt::tt_metal::operation::OldInfraDeviceOperation<std::vector<tt::tt_metal::Tensor, std::allocator<tt::tt_metal::Tensor> > >::operation_attributes_t const&, tt::tt_metal::operation::OldInfraDeviceOperation<std::vector<tt::tt_metal::Tensor, std::allocator<tt::tt_metal::Tensor> > >::tensor_args_t const&)
E --- /__w/tt-forge-fe/tt-forge-fe/third_party/tt-mlir/third_party/tt-metal/src/tt-metal-build/lib/_ttnn.so(+0x3080fa9) [0x7fe4a4af7fa9]
E --- tt::tt_metal::operation::OldInfraDeviceOperation<std::vector<tt::tt_metal::Tensor, std::allocator<tt::tt_metal::Tensor> > >::tensor_return_value_t ttnn::device_operation::detail::invoke<tt::tt_metal::operation::OldInfraDeviceOperation<std::vector<tt::tt_metal::Tensor, std::allocator<tt::tt_metal::Tensor> > > >(unsigned char, tt::tt_metal::operation::OldInfraDeviceOperation<std::vector<tt::tt_metal::Tensor, std::allocator<tt::tt_metal::Tensor> > >::operation_attributes_t const&, tt::tt_metal::operation::OldInfraDeviceOperation<std::vector<tt::tt_metal::Tensor, std::allocator<tt::tt_metal::Tensor> > >::tensor_args_t const&)
E --- /__w/tt-forge-fe/tt-forge-fe/third_party/tt-mlir/third_party/tt-metal/src/tt-metal-build/lib/_ttnn.so(+0x307d6ef) [0x7fe4a4af46ef]
E --- /__w/tt-forge-fe/tt-forge-fe/third_party/tt-mlir/third_party/tt-metal/src/tt-metal-build/lib/_ttnn.so(_ZN2tt8tt_metal9operation19run_with_autoformatEONS1_15DeviceOperationISt6vectorINS0_6TensorESaIS4_EEEERKS6_RKS3_IN4ttnn10operations12experimental11auto_format12FormatParamsESaISF_EERKS3_INS0_6LayoutESaISK_EERKS3_ISt8optionalIKS4_ESaISR_EERKS3_ISP_ISF_ESaISW_EERKS3_ISP_IS4_ESaIS11_EEh+0x503) [0x7fe4a4af1603]
E --- /__w/tt-forge-fe/tt-forge-fe/third_party/tt-mlir/third_party/tt-metal/src/tt-metal-build/lib/_ttnn.so(+0x6cbf69) [0x7fe4a2142f69]
E --- /__w/tt-forge-fe/tt-forge-fe/third_party/tt-mlir/third_party/tt-metal/src/tt-metal-build/lib/_ttnn.so(+0x6ce96b) [0x7fe4a214596b]
E --- /__w/tt-forge-fe/tt-forge-fe/third_party/tt-mlir/third_party/tt-metal/src/tt-metal-build/lib/_ttnn.so(+0x6cf51c) [0x7fe4a214651c]
E --- ttnn::operations::data_movement::concat_impl(std::vector<tt::tt_metal::Tensor, std::allocator<tt::tt_metal::Tensor> > const&, long, unsigned int, tt::tt_metal::MemoryConfig const&)
E --- /__w/tt-forge-fe/tt-forge-fe/third_party/tt-mlir/third_party/tt-metal/src/tt-metal-build/lib/_ttnn.so(+0x6c660b) [0x7fe4a213d60b]
E --- /__w/tt-forge-fe/tt-forge-fe/third_party/tt-mlir/third_party/tt-metal/src/tt-metal-build/lib/_ttnn.so(+0x692d65) [0x7fe4a2109d65]
E --- ttnn::operations::data_movement::ConcatOperation::invoke(unsigned char, std::vector<tt::tt_metal::Tensor, std::allocator<tt::tt_metal::Tensor> > const&, int, std::optional<tt::tt_metal::MemoryConfig> const&, std::optional<tt::tt_metal::Tensor> const&, unsigned int)
E --- ttnn::operations::data_movement::ConcatOperation::invoke(std::vector<tt::tt_metal::Tensor, std::allocator<tt::tt_metal::Tensor> > const&, int, std::optional<tt::tt_metal::MemoryConfig> const&, std::optional<tt::tt_metal::Tensor> const&, unsigned int)
E --- /__w/tt-forge-fe/tt-forge-fe/third_party/tt-mlir/third_party/tt-metal/src/tt-metal-build/lib/_ttnn.so(+0x6064e1) [0x7fe4a207d4e1]
E --- /__w/tt-forge-fe/tt-forge-fe/third_party/tt-mlir/third_party/tt-metal/src/tt-metal-build/lib/_ttnn.so(+0x6047cf) [0x7fe4a207b7cf]
E --- /__w/tt-forge-fe/tt-forge-fe/third_party/tt-mlir/third_party/tt-metal/src/tt-metal-build/lib/_ttnn.so(+0x60430c) [0x7fe4a207b30c]
E --- /__w/tt-forge-fe/tt-forge-fe/third_party/tt-mlir/third_party/tt-metal/src/tt-metal-build/lib/_ttnn.so(+0x5ead11) [0x7fe4a2061d11]
E --- ttnn::operations::data_movement::ExecuteRepeatInterleave::invoke(tt::tt_metal::Tensor const&, unsigned int, int, std::optional<tt::tt_metal::MemoryConfig> const&)
E --- /__w/tt-forge-fe/tt-forge-fe/third_party/tt-mlir/build/lib/SharedLib/libTTMLIR.so(+0x797067) [0x7fe4a66f5067]
E --- /__w/tt-forge-fe/tt-forge-fe/third_party/tt-mlir/build/lib/SharedLib/libTTMLIR.so(+0x797ba0) [0x7fe4a66f5ba0]
E --- /__w/tt-forge-fe/tt-forge-fe/third_party/tt-mlir/build/lib/SharedLib/libTTMLIR.so(+0x7984b1) [0x7fe4a66f64b1]
E --- /__w/tt-forge-fe/tt-forge-fe/third_party/tt-mlir/build/lib/SharedLib/libTTMLIR.so(+0x79604f) [0x7fe4a66f404f]
E --- /__w/tt-forge-fe/tt-forge-fe/third_party/tt-mlir/build/lib/SharedLib/libTTMLIR.so(+0x79483c) [0x7fe4a66f283c]
E --- /__w/tt-forge-fe/tt-forge-fe/third_party/tt-mlir/build/lib/SharedLib/libTTMLIR.so(+0x794317) [0x7fe4a66f2317]
E --- tt::runtime::ttnn::operations::data_movement::run(tt::target::ttnn::RepeatInterleaveOp const*, tt::runtime::ttnn::ProgramContext&)
E --- tt::runtime::ttnn::runProgram(tt::tt_metal::distributed::MeshDevice&, tt::runtime::Binary, unsigned int, std::vector<tt::tt_metal::Tensor*, std::allocator<tt::tt_metal::Tensor*> > const&)
E --- tt::runtime::ttnn::submit(tt::runtime::Device, tt::runtime::Binary, unsigned int, std::vector<tt::runtime::Tensor, std::allocator<tt::runtime::Tensor> > const&)
E --- tt::runtime::submit(tt::runtime::Device, tt::runtime::Binary, unsigned int, std::vector<tt::runtime::Tensor, std::allocator<tt::runtime::Tensor> > const&)
E --- tt::run_binary(tt::runtime::Binary&, int, std::vector<at::Tensor, std::allocator<at::Tensor> > const&)
E --- /__w/tt-forge-fe/tt-forge-fe/forge/forge/_C.so(+0x3174e0) [0x7fe4b2e464e0]
E --- /__w/tt-forge-fe/tt-forge-fe/forge/forge/_C.so(+0x31742e) [0x7fe4b2e4642e]
E --- /__w/tt-forge-fe/tt-forge-fe/forge/forge/_C.so(+0xe0cf5) [0x7fe4b2c0fcf5]
E --- /opt/ttforge-toolchain/venv/bin/python(+0x18ab32) [0x55ef57fe0b32]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_MakeTpCall+0x25b) [0x55ef57fd739b]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x59c7) [0x55ef57fd0a97]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_FastCallDictTstate+0xc4) [0x55ef57fd6574]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_Call_Prepend+0x5c) [0x55ef57feb62c]
E --- /opt/ttforge-toolchain/venv/bin/python(+0x29d464) [0x55ef580f3464]
E --- /opt/ttforge-toolchain/venv/bin/python(PyObject_Call+0xbb) [0x55ef57fef10b]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2b60) [0x55ef57fcdc30]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x6c0) [0x55ef57fcb790]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
E --- /opt/ttforge-toolchain/venv/bin/python(PyObject_Call+0x122) [0x55ef57fef172]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2b60) [0x55ef57fcdc30]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2b60) [0x55ef57fcdc30]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x18db) [0x55ef57fcc9ab]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x5632) [0x55ef57fd0702]
E --- /opt/ttforge-toolchain/venv/bin/python(+0x1984d1) [0x55ef57fee4d1]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x5632) [0x55ef57fd0702]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_FastCallDictTstate+0x16d) [0x55ef57fd661d]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_Call_Prepend+0x5c) [0x55ef57feb62c]
E --- /opt/ttforge-toolchain/venv/bin/python(+0x29d464) [0x55ef580f3464]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_MakeTpCall+0x25b) [0x55ef57fd739b]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x68ce) [0x55ef57fd199e]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x8af) [0x55ef57fcb97f]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2b60) [0x55ef57fcdc30]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x18db) [0x55ef57fcc9ab]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x5632) [0x55ef57fd0702]
E --- /opt/ttforge-toolchain/venv/bin/python(+0x1984d1) [0x55ef57fee4d1]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x5632) [0x55ef57fd0702]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_FastCallDictTstate+0x16d) [0x55ef57fd661d]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_Call_Prepend+0x5c) [0x55ef57feb62c]
E --- /opt/ttforge-toolchain/venv/bin/python(+0x29d464) [0x55ef580f3464]
E --- /opt/ttforge-toolchain/venv/bin/python(PyObject_Call+0xbb) [0x55ef57fef10b]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2b60) [0x55ef57fcdc30]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x6c0) [0x55ef57fcb790]
E --- /opt/ttforge-toolchain/venv/bin/python(+0x1984d1) [0x55ef57fee4d1]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x18db) [0x55ef57fcc9ab]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2b60) [0x55ef57fcdc30]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x6c0) [0x55ef57fcb790]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x18db) [0x55ef57fcc9ab]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2b60) [0x55ef57fcdc30]
forge/forge/compiled_graph_state.py:253: RuntimeError
Check failure on line 61 in forge/test/models/pytorch/text/qwen/test_qwen_coder.py
github-actions / TT-Forge-FE Tests
test_qwen_coder.test_qwen_clm[Qwen/Qwen2.5-Coder-0.5B]
RuntimeError: Input count mismatch: expected 534, got 535
Raw output
record_forge_property = <function record_property.<locals>.append_property at 0x7fe4db4a8e50>
variant = 'Qwen/Qwen2.5-Coder-0.5B'
@pytest.mark.parametrize("variant", variants, ids=variants)
@pytest.mark.nightly
def test_qwen_clm(record_forge_property, variant):
if variant != "Qwen/Qwen2.5-Coder-0.5B":
pytest.skip("Skipping due to the current CI/CD pipeline limitations")
# Build Module Name
module_name = build_module_name(
framework=Framework.PYTORCH, model="qwen_coder", variant=variant, task=Task.CAUSAL_LM, source=Source.HUGGINGFACE
)
# Record Forge Property
record_forge_property("model_name", module_name)
# Load model and tokenizer
framework_model = AutoModelForCausalLM.from_pretrained(variant, device_map="cpu")
framework_model.config.return_dict = False
tokenizer = AutoTokenizer.from_pretrained(variant)
# Prepare input
prompt = "write a quick sort algorithm."
messages = [
{"role": "system", "content": "You are Qwen, created by TT Cloud. You are a helpful assistant."},
{"role": "user", "content": prompt},
]
text = tokenizer.apply_chat_template(messages, tokenize=False, add_generation_prompt=True)
# Tokenize and prepare inputs
model_inputs = tokenizer([text], return_tensors="pt")
input_ids = model_inputs["input_ids"]
attention_mask = model_inputs["attention_mask"]
inputs = [input_ids, attention_mask]
# Forge compile framework model
compiled_model = forge.compile(framework_model, sample_inputs=inputs, module_name=module_name)
# Model Verification
> verify(inputs, framework_model, compiled_model)
forge/test/models/pytorch/text/qwen/test_qwen_coder.py:61:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
forge/forge/verify/verify.py:302: in verify
co_out = compiled_model(*inputs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <forge.compiled_graph_state.CompiledModel object at 0x7fe46eb7b100>
inputs = (tensor([[151644, 8948, 198, 2610, 525, 1207, 16948, 11, 3465, 553, 32744, 14817, 13, 14...), tensor([[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]]))
inputs_and_parameters = [tensor([[151644, 8948, 198, 2610, 525, 1207, 16948, 11, 3465, 553, 32744, 14817, 13, 14...., 0., 0.],
[0., 0., 0., ..., 0., 1., 0.],
[0., 0., 0., ..., 0., 0., 1.]]]]), tensor([-1.]), ...]
def __call__(self, *inputs: AnyTensor) -> List[torch.Tensor]:
"""
Run inference on the compiled model.
Parameters
----------
inputs: [Tensor, ...]
Input tensors
Returns
-------
List[Tensor]
Output tensors
"""
self.inputs = [*to_pt_tensors(inputs)]
inputs_and_parameters = [
*self.inputs,
*self.fwd_compiled_graph_state.get_ordered_constant_tensors(),
*self.fwd_compiled_graph_state.get_ordered_parameter_tensors(),
]
assert all(
[isinstance(t, torch.Tensor) for t in inputs_and_parameters]
), "All inputs should be torch tensors by now."
if self.training() and isinstance(self.framework_module, PyTorchModule):
for name, param in self.framework_module.module.named_parameters():
if param.requires_grad:
our_tensor = self.fwd_compiled_graph_state.get_parameter_tensor(name)
# NOTE: for parameters that require gradients, we want to share the same tensor with the PyTorch
# module. This is because we want to be able to optimize the parameters both on the device
# (through our runtime) and via the torch optimizers. So this ensures that whichever side updates
# the parameter value, the other side can see the change.
#
# This could change in the future, but for now ensure that our premise is correct.
assert param is our_tensor
logger.info(
f"Running model {self.framework_module.get_name()} {self.fwd_compiled_graph_state.graph.get_name()} on device..."
)
> all_outputs = run_binary(self.compiled_binary, int(ProgramId.FORWARD), inputs_and_parameters)
E RuntimeError: Input count mismatch: expected 534, got 535
forge/forge/compiled_graph_state.py:253: RuntimeError
Check failure on line 59 in forge/test/models/pytorch/text/t5/test_t5.py
github-actions / TT-Forge-FE Tests
test_t5.test_t5_generation[t5-large]
NameError: name 'AutoTokenizer' is not defined
Raw output
record_forge_property = <function record_property.<locals>.append_property at 0x7fe45a9db520>
variant = 't5-large'
@pytest.mark.nightly
@pytest.mark.parametrize("variant", variants)
def test_t5_generation(record_forge_property, variant):
if variant not in {"t5-small", "google/flan-t5-small", "t5-base", "t5-large"}:
pytest.skip(f"Skipping {variant} due to the current CI/CD pipeline limitations")
# Build Module Name
module_name = build_module_name(
framework=Framework.PYTORCH, model="t5", variant=variant, task=Task.TEXT_GENERATION, source=Source.HUGGINGFACE
)
# Record Forge Property
record_forge_property("model_name", module_name)
# Load tokenizer and model from HuggingFace
# Variants: t5-small, t5-base, t5-large
config = download_model(T5Config.from_pretrained, variant)
config_dict = config.to_dict()
config_dict["return_dict"] = False
config_dict["use_cache"] = False
config = T5Config(**config_dict)
model = download_model(T5ForConditionalGeneration.from_pretrained, variant, config=config)
> tokenizer = AutoTokenizer.from_pretrained(variant)
E NameError: name 'AutoTokenizer' is not defined
forge/test/models/pytorch/text/t5/test_t5.py:59: NameError
Check failure on line 163 in forge/test/models/pytorch/vision/efficientnet/test_efficientnet.py
github-actions / TT-Forge-FE Tests
test_efficientnet.test_efficientnet_torchvision[efficientnet_b0]
RuntimeError: TT_THROW @ /__w/tt-forge-fe/tt-forge-fe/third_party/tt-mlir/third_party/tt-metal/src/tt-metal/tt_metal/impl/program/program.cpp:896: tt::exception
info:
Statically allocated circular buffers on core range [(x=0,y=0) - (x=6,y=6)] grow to 1942368 B which is beyond max L1 size of 1499136 B
backtrace:
--- /__w/tt-forge-fe/tt-forge-fe/third_party/tt-mlir/third_party/tt-metal/src/tt-metal-build/lib/libtt_metal.so(+0x16059b) [0x7fe4a182a59b]
--- tt::tt_metal::detail::Program_::validate_circular_buffer_region(tt::tt_metal::v0::IDevice const*)
--- tt::tt_metal::v0::EnqueueProgram(tt::tt_metal::CommandQueue&, tt::tt_metal::v0::Program&, bool)
--- void ttnn::device_operation::detail::launch_on_worker_thread<tt::tt_metal::operation::OldInfraDeviceOperation<std::vector<tt::tt_metal::Tensor, std::allocator<tt::tt_metal::Tensor> > >, unsigned char, long, tt::tt_metal::operation::DeviceOperation<std::vector<tt::tt_metal::Tensor, std::allocator<tt::tt_metal::Tensor> > >, tt::tt_metal::operation::OldInfraDeviceOperation<std::vector<tt::tt_metal::Tensor, std::allocator<tt::tt_metal::Tensor> > >::tensor_args_t, std::vector<tt::tt_metal::Tensor, std::allocator<tt::tt_metal::Tensor> >, tt::tt_metal::v0::IDevice*>(unsigned char, long, tt::tt_metal::operation::DeviceOperation<std::vector<tt::tt_metal::Tensor, std::allocator<tt::tt_metal::Tensor> > > const&, tt::tt_metal::operation::OldInfraDeviceOperation<std::vector<tt::tt_metal::Tensor, std::allocator<tt::tt_metal::Tensor> > >::tensor_args_t const&, std::vector<tt::tt_metal::Tensor, std::allocator<tt::tt_metal::Tensor> >&, tt::tt_metal::v0::IDevice*&)
--- tt::tt_metal::operation::OldInfraDeviceOperation<std::vector<tt::tt_metal::Tensor, std::allocator<tt::tt_metal::Tensor> > >::tensor_return_value_t ttnn::device_operation::detail::launch_on_single_device<tt::tt_metal::operation::OldInfraDeviceOperation<std::vector<tt::tt_metal::Tensor, std::allocator<tt::tt_metal::Tensor> > > >(unsigned char, tt::tt_metal::operation::OldInfraDeviceOperation<std::vector<tt::tt_metal::Tensor, std::allocator<tt::tt_metal::Tensor> > >::operation_attributes_t const&, tt::tt_metal::operation::OldInfraDeviceOperation<std::vector<tt::tt_metal::Tensor, std::allocator<tt::tt_metal::Tensor> > >::tensor_args_t const&)
--- /__w/tt-forge-fe/tt-forge-fe/third_party/tt-mlir/third_party/tt-metal/src/tt-metal-build/lib/_ttnn.so(+0x3080fa9) [0x7fe4a4af7fa9]
--- tt::tt_metal::operation::OldInfraDeviceOperation<std::vector<tt::tt_metal::Tensor, std::allocator<tt::tt_metal::Tensor> > >::tensor_return_value_t ttnn::device_operation::detail::invoke<tt::tt_metal::operation::OldInfraDeviceOperation<std::vector<tt::tt_metal::Tensor, std::allocator<tt::tt_metal::Tensor> > > >(unsigned char, tt::tt_metal::operation::OldInfraDeviceOperation<std::vector<tt::tt_metal::Tensor, std::allocator<tt::tt_metal::Tensor> > >::operation_attributes_t const&, tt::tt_metal::operation::OldInfraDeviceOperation<std::vector<tt::tt_metal::Tensor, std::allocator<tt::tt_metal::Tensor> > >::tensor_args_t const&)
--- /__w/tt-forge-fe/tt-forge-fe/third_party/tt-mlir/third_party/tt-metal/src/tt-metal-build/lib/_ttnn.so(+0x307d6ef) [0x7fe4a4af46ef]
--- std::vector<tt::tt_metal::Tensor, std::allocator<tt::tt_metal::Tensor> > tt::tt_metal::operation::run_without_autoformat<std::vector<tt::tt_metal::Tensor, std::allocator<tt::tt_metal::Tensor> > >(tt::tt_metal::operation::DeviceOperation<std::vector<tt::tt_metal::Tensor, std::allocator<tt::tt_metal::Tensor> > >&&, std::vector<tt::tt_metal::Tensor, std::allocator<tt::tt_metal::Tensor> > const&, std::vector<std::optional<tt::tt_metal::Tensor const>, std::allocator<std::optional<tt::tt_metal::Tensor const> > > const&, std::vector<std::optional<tt::tt_metal::Tensor>, std::allocator<std::optional<tt::tt_metal::Tensor> > > const&, unsigned char)
--- /__w/tt-forge-fe/tt-forge-fe/third_party/tt-mlir/third_party/tt-metal/src/tt-metal-build/lib/_ttnn.so(+0x46b2b7) [0x7fe4a1ee22b7]
--- /__w/tt-forge-fe/tt-forge-fe/third_party/tt-mlir/third_party/tt-metal/src/tt-metal-build/lib/_ttnn.so(+0x474910) [0x7fe4a1eeb910]
--- /__w/tt-forge-fe/tt-forge-fe/third_party/tt-mlir/third_party/tt-metal/src/tt-metal-build/lib/_ttnn.so(+0x47556c) [0x7fe4a1eec56c]
--- /__w/tt-forge-fe/tt-forge-fe/third_party/tt-mlir/third_party/tt-metal/src/tt-metal-build/lib/_ttnn.so(_ZN4ttnn10operations4conv6conv2d18optimized_conv_newERKN2tt8tt_metal6TensorES7_St8optionalIS6_ERKNS0_14sliding_window19SlidingWindowConfigEjjbbRKNS2_34OptimizedConvParallelizationConfigERKNS2_24OptimizedConvBlockConfigERKNS4_12MemoryConfigENS4_8DataTypeESt5arrayIjLm4EEbRKSt7variantIJNS_28GrayskullComputeKernelConfigENS_27WormholeComputeKernelConfigEEEbbbbb+0x18f1) [0x7fe4a1e6a961]
--- /__w/tt-forge-fe/tt-forge-fe/third_party/tt-mlir/third_party/tt-metal/src/tt-metal-build/lib/_ttnn.so(_ZN4ttnn10operations4conv6conv2d6conv2dIN2tt8tt_metal2v07IDeviceEEESt5tupleIJNS5_6TensorEjjS9_St8optionalIS9_EEERKS9_SE_PT_jjjjjSt5arrayIjLm2EESI_SI_SI_jSA_ISD_ERKSA_IKNS2_12Conv2dConfigEERKSA_IKSt7variantIJNS_28GrayskullComputeKernelConfigENS_27WormholeComputeKernelConfigEEEERKSA_IKNS5_12MemoryConfigEE+0xf7b) [0x7fe4a1e584bb]
--- /__w/tt-forge-fe/tt-forge-fe/third_party/tt-mlir/build/lib/SharedLib/libTTMLIR.so(+0x775b53) [0x7fe4a66d3b53]
--- tt::runtime::ttnn::operations::conv::run(tt::target::ttnn::Conv2dOp const*, tt::runtime::ttnn::ProgramContext&)
--- tt::runtime::ttnn::runProgram(tt::tt_metal::distributed::MeshDevice&, tt::runtime::Binary, unsigned int, std::vector<tt::tt_metal::Tensor*, std::allocator<tt::tt_metal::Tensor*> > const&)
--- tt::runtime::ttnn::submit(tt::runtime::Device, tt::runtime::Binary, unsigned int, std::vector<tt::runtime::Tensor, std::allocator<tt::runtime::Tensor> > const&)
--- tt::runtime::submit(tt::runtime::Device, tt::runtime::Binary, unsigned int, std::vector<tt::runtime::Tensor, std::allocator<tt::runtime::Tensor> > const&)
--- tt::run_binary(tt::runtime::Binary&, int, std::vector<at::Tensor, std::allocator<at::Tensor> > const&)
--- /__w/tt-forge-fe/tt-forge-fe/forge/forge/_C.so(+0x3174e0) [0x7fe4b2e464e0]
--- /__w/tt-forge-fe/tt-forge-fe/forge/forge/_C.so(+0x31742e) [0x7fe4b2e4642e]
--- /__w/tt-forge-fe/tt-forge-fe/forge/forge/_C.so(+0xe0cf5) [0x7fe4b2c0fcf5]
--- /opt/ttforge-toolchain/venv/bin/python(+0x18ab32) [0x55ef57fe0b32]
--- /opt/ttforge-toolchain/venv/bin/python(_PyObject_MakeTpCall+0x25b) [0x55ef57fd739b]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x59c7) [0x55ef57fd0a97]
--- /opt/ttforge-toolchain/venv/bin/python(_PyObject_FastCallDictTstate+0xc4) [0x55ef57fd6574]
--- /opt/ttforge-toolchain/venv/bin/python(_PyObject_Call_Prepend+0x5c) [0x55ef57feb62c]
--- /opt/ttforge-toolchain/venv/bin/python(+0x29d464) [0x55ef580f3464]
--- /opt/ttforge-toolchain/venv/bin/python(PyObject_Call+0xbb) [0x55ef57fef10b]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2b60) [0x55ef57fcdc30]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x6c0) [0x55ef57fcb790]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
--- /opt/ttforge-toolchain/venv/bin/python(PyObject_Call+0x122) [0x55ef57fef172]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2b60) [0x55ef57fcdc30]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2b60) [0x55ef57fcdc30]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x18db) [0x55ef57fcc9ab]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x5632) [0x55ef57fd0702]
--- /opt/ttforge-toolchain/venv/bin/python(+0x1984d1) [0x55ef57fee4d1]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x5632) [0x55ef57fd0702]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyObject_FastCallDictTstate+0x16d) [0x55ef57fd661d]
--- /opt/ttforge-toolchain/venv/bin/python(_PyObject_Call_Prepend+0x5c) [0x55ef57feb62c]
--- /opt/ttforge-toolchain/venv/bin/python(+0x29d464) [0x55ef580f3464]
--- /opt/ttforge-toolchain/venv/bin/python(_PyObject_MakeTpCall+0x25b) [0x55ef57fd739b]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x68ce) [0x55ef57fd199e]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x8af) [0x55ef57fcb97f]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2b60) [0x55ef57fcdc30]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x18db) [0x55ef57fcc9ab]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x5632) [0x55ef57fd0702]
--- /opt/ttforge-toolchain/venv/bin/python(+0x1984d1) [0x55ef57fee4d1]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x5632) [0x55ef57fd0702]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyObject_FastCallDictTstate+0x16d) [0x55ef57fd661d]
--- /opt/ttforge-toolchain/venv/bin/python(_PyObject_Call_Prepend+0x5c) [0x55ef57feb62c]
--- /opt/ttforge-toolchain/venv/bin/python(+0x29d464) [0x55ef580f3464]
--- /opt/ttforge-toolchain/venv/bin/python(PyObject_Call+0xbb) [0x55ef57fef10b]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2b60) [0x55ef57fcdc30]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x6c0) [0x55ef57fcb790]
--- /opt/ttforge-toolchain/venv/bin/python(+0x1984d1) [0x55ef57fee4d1]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x18db) [0x55ef57fcc9ab]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2b60) [0x55ef57fcdc30]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x6c0) [0x55ef57fcb790]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x18db) [0x55ef57fcc9ab]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2b60) [0x55ef57fcdc30]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x18db) [0x55ef57fcc9ab]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x5632) [0x55ef57fd0702]
--- /opt/ttforge-toolchain/venv/bin/python(+0x1984d1) [0x55ef57fee4d1]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x5632) [0x55ef57fd0702]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyObject_FastCallDictTstate+0x16d) [0x55ef57fd661d]
--- /opt/ttforge-toolchain/venv/bin/python(_PyObject_Call_Prepend+0x5c) [0x55ef57feb62c]
--- /opt/ttforge-toolchain/venv/bin/python(+0x29d464) [0x55ef580f3464]
--- /opt/ttforge-toolchain/venv/bin/python(_PyObject_MakeTpCall+0x25b) [0x55ef57fd739b]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x68ce) [0x55ef57fd199e]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2b60) [0x55ef57fcdc30]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x18db) [0x55ef57fcc9ab]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x5632) [0x55ef57fd0702]
--- /opt/ttforge-toolchain/venv/bin/python(+0x1984d1) [0x55ef57fee4d1]
Raw output
record_forge_property = <function record_property.<locals>.append_property at 0x7fe3c04e25f0>
variant = 'efficientnet_b0'
@pytest.mark.nightly
@pytest.mark.parametrize("variant", variants)
def test_efficientnet_torchvision(record_forge_property, variant):
if variant != "efficientnet_b0":
pytest.skip("Skipping due to the current CI/CD pipeline limitations")
# Build Module Name
module_name = build_module_name(
framework=Framework.PYTORCH,
model="efficientnet",
variant=variant,
source=Source.TORCHVISION,
task=Task.IMAGE_CLASSIFICATION,
)
# Record Forge Property
record_forge_property("model_name", module_name)
# Load model
if variant == "efficientnet_b0":
framework_model = efficientnet_b0(weights=EfficientNet_B0_Weights.IMAGENET1K_V1)
elif variant == "efficientnet_b4":
framework_model = efficientnet_b4(weights=EfficientNet_B4_Weights.IMAGENET1K_V1)
framework_model.eval()
# Load and pre-process image
try:
url, filename = (
"https://github.com/pytorch/hub/raw/master/images/dog.jpg",
"dog.jpg",
)
urllib.request.urlretrieve(url, filename)
img = Image.open(filename).convert("RGB")
config = resolve_data_config({}, model=framework_model)
transform = create_transform(**config)
img_tensor = transform(img).unsqueeze(0)
except:
logger.warning(
"Failed to download the image file, replacing input with random tensor. Please check if the URL is up to date"
)
img_tensor = torch.rand(1, 3, 224, 224)
inputs = [img_tensor]
# Forge compile framework model
compiled_model = forge.compile(framework_model, sample_inputs=inputs, module_name=module_name)
# Model Verification
> verify(inputs, framework_model, compiled_model)
forge/test/models/pytorch/vision/efficientnet/test_efficientnet.py:163:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
forge/forge/verify/verify.py:302: in verify
co_out = compiled_model(*inputs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <forge.compiled_graph_state.CompiledModel object at 0x7fe45fe90580>
inputs = (tensor([[[[-1.92953, -1.92953, -1.92953, ..., -2.04940, -1.92953, -1.92953],
[-2.01516, -1.87816, -1.89528... ..., -0.91556, -1.61272, -1.40357],
[-1.26414, -1.43843, -1.19442, ..., -0.67155, -1.14213, -1.28157]]]]),)
inputs_and_parameters = [tensor([[[[-1.92953, -1.92953, -1.92953, ..., -2.04940, -1.92953, -1.92953],
[-2.01516, -1.87816, -1.89528...2.44088, 3.86180, 3.68086, 2.09527, 3.81788, 4.29909, 4.17497, 2.64127, 3.81770, 3.27010]]]], requires_grad=True), ...]
def __call__(self, *inputs: AnyTensor) -> List[torch.Tensor]:
"""
Run inference on the compiled model.
Parameters
----------
inputs: [Tensor, ...]
Input tensors
Returns
-------
List[Tensor]
Output tensors
"""
self.inputs = [*to_pt_tensors(inputs)]
inputs_and_parameters = [
*self.inputs,
*self.fwd_compiled_graph_state.get_ordered_constant_tensors(),
*self.fwd_compiled_graph_state.get_ordered_parameter_tensors(),
]
assert all(
[isinstance(t, torch.Tensor) for t in inputs_and_parameters]
), "All inputs should be torch tensors by now."
if self.training() and isinstance(self.framework_module, PyTorchModule):
for name, param in self.framework_module.module.named_parameters():
if param.requires_grad:
our_tensor = self.fwd_compiled_graph_state.get_parameter_tensor(name)
# NOTE: for parameters that require gradients, we want to share the same tensor with the PyTorch
# module. This is because we want to be able to optimize the parameters both on the device
# (through our runtime) and via the torch optimizers. So this ensures that whichever side updates
# the parameter value, the other side can see the change.
#
# This could change in the future, but for now ensure that our premise is correct.
assert param is our_tensor
logger.info(
f"Running model {self.framework_module.get_name()} {self.fwd_compiled_graph_state.graph.get_name()} on device..."
)
> all_outputs = run_binary(self.compiled_binary, int(ProgramId.FORWARD), inputs_and_parameters)
E RuntimeError: TT_THROW @ /__w/tt-forge-fe/tt-forge-fe/third_party/tt-mlir/third_party/tt-metal/src/tt-metal/tt_metal/impl/program/program.cpp:896: tt::exception
E info:
E Statically allocated circular buffers on core range [(x=0,y=0) - (x=6,y=6)] grow to 1942368 B which is beyond max L1 size of 1499136 B
E backtrace:
E --- /__w/tt-forge-fe/tt-forge-fe/third_party/tt-mlir/third_party/tt-metal/src/tt-metal-build/lib/libtt_metal.so(+0x16059b) [0x7fe4a182a59b]
E --- tt::tt_metal::detail::Program_::validate_circular_buffer_region(tt::tt_metal::v0::IDevice const*)
E --- tt::tt_metal::v0::EnqueueProgram(tt::tt_metal::CommandQueue&, tt::tt_metal::v0::Program&, bool)
E --- void ttnn::device_operation::detail::launch_on_worker_thread<tt::tt_metal::operation::OldInfraDeviceOperation<std::vector<tt::tt_metal::Tensor, std::allocator<tt::tt_metal::Tensor> > >, unsigned char, long, tt::tt_metal::operation::DeviceOperation<std::vector<tt::tt_metal::Tensor, std::allocator<tt::tt_metal::Tensor> > >, tt::tt_metal::operation::OldInfraDeviceOperation<std::vector<tt::tt_metal::Tensor, std::allocator<tt::tt_metal::Tensor> > >::tensor_args_t, std::vector<tt::tt_metal::Tensor, std::allocator<tt::tt_metal::Tensor> >, tt::tt_metal::v0::IDevice*>(unsigned char, long, tt::tt_metal::operation::DeviceOperation<std::vector<tt::tt_metal::Tensor, std::allocator<tt::tt_metal::Tensor> > > const&, tt::tt_metal::operation::OldInfraDeviceOperation<std::vector<tt::tt_metal::Tensor, std::allocator<tt::tt_metal::Tensor> > >::tensor_args_t const&, std::vector<tt::tt_metal::Tensor, std::allocator<tt::tt_metal::Tensor> >&, tt::tt_metal::v0::IDevice*&)
E --- tt::tt_metal::operation::OldInfraDeviceOperation<std::vector<tt::tt_metal::Tensor, std::allocator<tt::tt_metal::Tensor> > >::tensor_return_value_t ttnn::device_operation::detail::launch_on_single_device<tt::tt_metal::operation::OldInfraDeviceOperation<std::vector<tt::tt_metal::Tensor, std::allocator<tt::tt_metal::Tensor> > > >(unsigned char, tt::tt_metal::operation::OldInfraDeviceOperation<std::vector<tt::tt_metal::Tensor, std::allocator<tt::tt_metal::Tensor> > >::operation_attributes_t const&, tt::tt_metal::operation::OldInfraDeviceOperation<std::vector<tt::tt_metal::Tensor, std::allocator<tt::tt_metal::Tensor> > >::tensor_args_t const&)
E --- /__w/tt-forge-fe/tt-forge-fe/third_party/tt-mlir/third_party/tt-metal/src/tt-metal-build/lib/_ttnn.so(+0x3080fa9) [0x7fe4a4af7fa9]
E --- tt::tt_metal::operation::OldInfraDeviceOperation<std::vector<tt::tt_metal::Tensor, std::allocator<tt::tt_metal::Tensor> > >::tensor_return_value_t ttnn::device_operation::detail::invoke<tt::tt_metal::operation::OldInfraDeviceOperation<std::vector<tt::tt_metal::Tensor, std::allocator<tt::tt_metal::Tensor> > > >(unsigned char, tt::tt_metal::operation::OldInfraDeviceOperation<std::vector<tt::tt_metal::Tensor, std::allocator<tt::tt_metal::Tensor> > >::operation_attributes_t const&, tt::tt_metal::operation::OldInfraDeviceOperation<std::vector<tt::tt_metal::Tensor, std::allocator<tt::tt_metal::Tensor> > >::tensor_args_t const&)
E --- /__w/tt-forge-fe/tt-forge-fe/third_party/tt-mlir/third_party/tt-metal/src/tt-metal-build/lib/_ttnn.so(+0x307d6ef) [0x7fe4a4af46ef]
E --- std::vector<tt::tt_metal::Tensor, std::allocator<tt::tt_metal::Tensor> > tt::tt_metal::operation::run_without_autoformat<std::vector<tt::tt_metal::Tensor, std::allocator<tt::tt_metal::Tensor> > >(tt::tt_metal::operation::DeviceOperation<std::vector<tt::tt_metal::Tensor, std::allocator<tt::tt_metal::Tensor> > >&&, std::vector<tt::tt_metal::Tensor, std::allocator<tt::tt_metal::Tensor> > const&, std::vector<std::optional<tt::tt_metal::Tensor const>, std::allocator<std::optional<tt::tt_metal::Tensor const> > > const&, std::vector<std::optional<tt::tt_metal::Tensor>, std::allocator<std::optional<tt::tt_metal::Tensor> > > const&, unsigned char)
E --- /__w/tt-forge-fe/tt-forge-fe/third_party/tt-mlir/third_party/tt-metal/src/tt-metal-build/lib/_ttnn.so(+0x46b2b7) [0x7fe4a1ee22b7]
E --- /__w/tt-forge-fe/tt-forge-fe/third_party/tt-mlir/third_party/tt-metal/src/tt-metal-build/lib/_ttnn.so(+0x474910) [0x7fe4a1eeb910]
E --- /__w/tt-forge-fe/tt-forge-fe/third_party/tt-mlir/third_party/tt-metal/src/tt-metal-build/lib/_ttnn.so(+0x47556c) [0x7fe4a1eec56c]
E --- /__w/tt-forge-fe/tt-forge-fe/third_party/tt-mlir/third_party/tt-metal/src/tt-metal-build/lib/_ttnn.so(_ZN4ttnn10operations4conv6conv2d18optimized_conv_newERKN2tt8tt_metal6TensorES7_St8optionalIS6_ERKNS0_14sliding_window19SlidingWindowConfigEjjbbRKNS2_34OptimizedConvParallelizationConfigERKNS2_24OptimizedConvBlockConfigERKNS4_12MemoryConfigENS4_8DataTypeESt5arrayIjLm4EEbRKSt7variantIJNS_28GrayskullComputeKernelConfigENS_27WormholeComputeKernelConfigEEEbbbbb+0x18f1) [0x7fe4a1e6a961]
E --- /__w/tt-forge-fe/tt-forge-fe/third_party/tt-mlir/third_party/tt-metal/src/tt-metal-build/lib/_ttnn.so(_ZN4ttnn10operations4conv6conv2d6conv2dIN2tt8tt_metal2v07IDeviceEEESt5tupleIJNS5_6TensorEjjS9_St8optionalIS9_EEERKS9_SE_PT_jjjjjSt5arrayIjLm2EESI_SI_SI_jSA_ISD_ERKSA_IKNS2_12Conv2dConfigEERKSA_IKSt7variantIJNS_28GrayskullComputeKernelConfigENS_27WormholeComputeKernelConfigEEEERKSA_IKNS5_12MemoryConfigEE+0xf7b) [0x7fe4a1e584bb]
E --- /__w/tt-forge-fe/tt-forge-fe/third_party/tt-mlir/build/lib/SharedLib/libTTMLIR.so(+0x775b53) [0x7fe4a66d3b53]
E --- tt::runtime::ttnn::operations::conv::run(tt::target::ttnn::Conv2dOp const*, tt::runtime::ttnn::ProgramContext&)
E --- tt::runtime::ttnn::runProgram(tt::tt_metal::distributed::MeshDevice&, tt::runtime::Binary, unsigned int, std::vector<tt::tt_metal::Tensor*, std::allocator<tt::tt_metal::Tensor*> > const&)
E --- tt::runtime::ttnn::submit(tt::runtime::Device, tt::runtime::Binary, unsigned int, std::vector<tt::runtime::Tensor, std::allocator<tt::runtime::Tensor> > const&)
E --- tt::runtime::submit(tt::runtime::Device, tt::runtime::Binary, unsigned int, std::vector<tt::runtime::Tensor, std::allocator<tt::runtime::Tensor> > const&)
E --- tt::run_binary(tt::runtime::Binary&, int, std::vector<at::Tensor, std::allocator<at::Tensor> > const&)
E --- /__w/tt-forge-fe/tt-forge-fe/forge/forge/_C.so(+0x3174e0) [0x7fe4b2e464e0]
E --- /__w/tt-forge-fe/tt-forge-fe/forge/forge/_C.so(+0x31742e) [0x7fe4b2e4642e]
E --- /__w/tt-forge-fe/tt-forge-fe/forge/forge/_C.so(+0xe0cf5) [0x7fe4b2c0fcf5]
E --- /opt/ttforge-toolchain/venv/bin/python(+0x18ab32) [0x55ef57fe0b32]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_MakeTpCall+0x25b) [0x55ef57fd739b]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x59c7) [0x55ef57fd0a97]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_FastCallDictTstate+0xc4) [0x55ef57fd6574]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_Call_Prepend+0x5c) [0x55ef57feb62c]
E --- /opt/ttforge-toolchain/venv/bin/python(+0x29d464) [0x55ef580f3464]
E --- /opt/ttforge-toolchain/venv/bin/python(PyObject_Call+0xbb) [0x55ef57fef10b]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2b60) [0x55ef57fcdc30]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x6c0) [0x55ef57fcb790]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
E --- /opt/ttforge-toolchain/venv/bin/python(PyObject_Call+0x122) [0x55ef57fef172]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2b60) [0x55ef57fcdc30]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2b60) [0x55ef57fcdc30]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x18db) [0x55ef57fcc9ab]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x5632) [0x55ef57fd0702]
E --- /opt/ttforge-toolchain/venv/bin/python(+0x1984d1) [0x55ef57fee4d1]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x5632) [0x55ef57fd0702]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_FastCallDictTstate+0x16d) [0x55ef57fd661d]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_Call_Prepend+0x5c) [0x55ef57feb62c]
E --- /opt/ttforge-toolchain/venv/bin/python(+0x29d464) [0x55ef580f3464]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_MakeTpCall+0x25b) [0x55ef57fd739b]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x68ce) [0x55ef57fd199e]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x8af) [0x55ef57fcb97f]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2b60) [0x55ef57fcdc30]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x18db) [0x55ef57fcc9ab]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x5632) [0x55ef57fd0702]
E --- /opt/ttforge-toolchain/venv/bin/python(+0x1984d1) [0x55ef57fee4d1]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x5632) [0x55ef57fd0702]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_FastCallDictTstate+0x16d) [0x55ef57fd661d]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_Call_Prepend+0x5c) [0x55ef57feb62c]
E --- /opt/ttforge-toolchain/venv/bin/python(+0x29d464) [0x55ef580f3464]
E --- /opt/ttforge-toolchain/venv/bin/python(PyObject_Call+0xbb) [0x55ef57fef10b]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2b60) [0x55ef57fcdc30]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x6c0) [0x55ef57fcb790]
E --- /opt/ttforge-toolchain/venv/bin/python(+0x1984d1) [0x55ef57fee4d1]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x18db) [0x55ef57fcc9ab]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2b60) [0x55ef57fcdc30]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x6c0) [0x55ef57fcb790]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x18db) [0x55ef57fcc9ab]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2b60) [0x55ef57fcdc30]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x18db) [0x55ef57fcc9ab]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x5632) [0x55ef57fd0702]
E --- /opt/ttforge-toolchain/venv/bin/python(+0x1984d1) [0x55ef57fee4d1]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x5632) [0x55ef57fd0702]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_FastCallDictTstate+0x16d) [0x55ef57fd661d]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_Call_Prepend+0x5c) [0x55ef57feb62c]
E --- /opt/ttforge-toolchain/venv/bin/python(+0x29d464) [0x55ef580f3464]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_MakeTpCall+0x25b) [0x55ef57fd739b]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x68ce) [0x55ef57fd199e]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2b60) [0x55ef57fcdc30]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x18db) [0x55ef57fcc9ab]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x5632) [0x55ef57fd0702]
E --- /opt/ttforge-toolchain/venv/bin/python(+0x1984d1) [0x55ef57fee4d1]
forge/forge/compiled_graph_state.py:253: RuntimeError
Check failure on line 34 in forge/test/models/onnx/vision/fpn/test_fpn.py
github-actions / TT-Forge-FE Tests
test_fpn.test_fpn_pytorch
RuntimeError: Found Unsupported operations while lowering from TTForge to TTIR in forward graph
Raw output
record_forge_property = <function record_property.<locals>.append_property at 0x7fe54cc63130>
@pytest.mark.nightly
def test_fpn_pytorch(record_forge_property):
# Build Module Name
module_name = build_module_name(
framework=Framework.PYTORCH, model="fpn", source=Source.TORCHVISION, task=Task.IMAGE_CLASSIFICATION
)
# Record Forge Property
record_forge_property("model_name", module_name)
# Load FPN model
framework_model = FPNWrapper()
feat0 = torch.rand(1, 256, 64, 64)
feat1 = torch.rand(1, 512, 16, 16)
feat2 = torch.rand(1, 2048, 8, 8)
inputs = [feat0, feat1, feat2]
# Forge compile framework model
> compiled_model = forge.compile(framework_model, sample_inputs=inputs, module_name=module_name)
forge/test/models/pytorch/vision/fpn/test_fpn.py:34:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
forge/forge/compile.py:253: in compile_main
return forge_compile_from_context(compile_context)
forge/forge/compile.py:295: in forge_compile_from_context
next_stage = stage_to_func[current_stage](context)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
context = CompileContext(modules=[Module pt_fpn_base_img_cls_torchvision], graph_name='pt_fpn_base_img_cls_torchvision', compile...cles_offset=0, forge_module=<forge._C.ForgeGraphModule object at 0x7fe4db409cf0>, compiled_binary=None, attach_to=None)
def run_mlir_compiler(context: CompileContext) -> CompileDepth:
assert context.forge_module is not None
> context.compiled_binary = forge._C.run_mlir_compiler(context.forge_module)
E RuntimeError: Found Unsupported operations while lowering from TTForge to TTIR in forward graph
forge/forge/compile.py:976: RuntimeError
Check failure on line 59 in forge/test/models/pytorch/vision/googlenet/test_googlenet.py
github-actions / TT-Forge-FE Tests
test_googlenet.test_googlenet_pytorch
RuntimeError: TT_FATAL @ /__w/tt-forge-fe/tt-forge-fe/third_party/tt-mlir/third_party/tt-metal/src/tt-metal/ttnn/cpp/ttnn/tensor/tensor_utils.cpp:50: new_volume == old_volume
info:
Invalid arguments to reshape
backtrace:
--- /__w/tt-forge-fe/tt-forge-fe/third_party/tt-mlir/build/lib/SharedLib/libTTMLIR.so(+0x6a8bf8) [0x7fe4a6606bf8]
--- tt::tt_metal::infer_dims_for_reshape(tt::tt_metal::Tensor const&, tt::stl::Span<int const, 18446744073709551615ul>)
--- ttnn::operations::data_movement::ReshapeViewOperation::invoke(tt::tt_metal::Tensor const&, tt::stl::Span<int const, 18446744073709551615ul>)
--- /__w/tt-forge-fe/tt-forge-fe/third_party/tt-mlir/build/lib/SharedLib/libTTMLIR.so(+0x78fb0b) [0x7fe4a66edb0b]
--- tt::runtime::ttnn::operations::data_movement::run(tt::target::ttnn::ReshapeOp const*, tt::runtime::ttnn::ProgramContext&)
--- tt::runtime::ttnn::runProgram(tt::tt_metal::distributed::MeshDevice&, tt::runtime::Binary, unsigned int, std::vector<tt::tt_metal::Tensor*, std::allocator<tt::tt_metal::Tensor*> > const&)
--- tt::runtime::ttnn::submit(tt::runtime::Device, tt::runtime::Binary, unsigned int, std::vector<tt::runtime::Tensor, std::allocator<tt::runtime::Tensor> > const&)
--- tt::runtime::submit(tt::runtime::Device, tt::runtime::Binary, unsigned int, std::vector<tt::runtime::Tensor, std::allocator<tt::runtime::Tensor> > const&)
--- tt::run_binary(tt::runtime::Binary&, int, std::vector<at::Tensor, std::allocator<at::Tensor> > const&)
--- /__w/tt-forge-fe/tt-forge-fe/forge/forge/_C.so(+0x3174e0) [0x7fe4b2e464e0]
--- /__w/tt-forge-fe/tt-forge-fe/forge/forge/_C.so(+0x31742e) [0x7fe4b2e4642e]
--- /__w/tt-forge-fe/tt-forge-fe/forge/forge/_C.so(+0xe0cf5) [0x7fe4b2c0fcf5]
--- /opt/ttforge-toolchain/venv/bin/python(+0x18ab32) [0x55ef57fe0b32]
--- /opt/ttforge-toolchain/venv/bin/python(_PyObject_MakeTpCall+0x25b) [0x55ef57fd739b]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x59c7) [0x55ef57fd0a97]
--- /opt/ttforge-toolchain/venv/bin/python(_PyObject_FastCallDictTstate+0xc4) [0x55ef57fd6574]
--- /opt/ttforge-toolchain/venv/bin/python(_PyObject_Call_Prepend+0x5c) [0x55ef57feb62c]
--- /opt/ttforge-toolchain/venv/bin/python(+0x29d464) [0x55ef580f3464]
--- /opt/ttforge-toolchain/venv/bin/python(PyObject_Call+0xbb) [0x55ef57fef10b]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2b60) [0x55ef57fcdc30]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x6c0) [0x55ef57fcb790]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
--- /opt/ttforge-toolchain/venv/bin/python(PyObject_Call+0x122) [0x55ef57fef172]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2b60) [0x55ef57fcdc30]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2b60) [0x55ef57fcdc30]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x18db) [0x55ef57fcc9ab]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x5632) [0x55ef57fd0702]
--- /opt/ttforge-toolchain/venv/bin/python(+0x1984d1) [0x55ef57fee4d1]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x5632) [0x55ef57fd0702]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyObject_FastCallDictTstate+0x16d) [0x55ef57fd661d]
--- /opt/ttforge-toolchain/venv/bin/python(_PyObject_Call_Prepend+0x5c) [0x55ef57feb62c]
--- /opt/ttforge-toolchain/venv/bin/python(+0x29d464) [0x55ef580f3464]
--- /opt/ttforge-toolchain/venv/bin/python(_PyObject_MakeTpCall+0x25b) [0x55ef57fd739b]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x68ce) [0x55ef57fd199e]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x8af) [0x55ef57fcb97f]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2b60) [0x55ef57fcdc30]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x18db) [0x55ef57fcc9ab]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x5632) [0x55ef57fd0702]
--- /opt/ttforge-toolchain/venv/bin/python(+0x1984d1) [0x55ef57fee4d1]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x5632) [0x55ef57fd0702]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyObject_FastCallDictTstate+0x16d) [0x55ef57fd661d]
--- /opt/ttforge-toolchain/venv/bin/python(_PyObject_Call_Prepend+0x5c) [0x55ef57feb62c]
--- /opt/ttforge-toolchain/venv/bin/python(+0x29d464) [0x55ef580f3464]
--- /opt/ttforge-toolchain/venv/bin/python(PyObject_Call+0xbb) [0x55ef57fef10b]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2b60) [0x55ef57fcdc30]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x6c0) [0x55ef57fcb790]
--- /opt/ttforge-toolchain/venv/bin/python(+0x1984d1) [0x55ef57fee4d1]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x18db) [0x55ef57fcc9ab]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2b60) [0x55ef57fcdc30]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x6c0) [0x55ef57fcb790]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x18db) [0x55ef57fcc9ab]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2b60) [0x55ef57fcdc30]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x18db) [0x55ef57fcc9ab]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x5632) [0x55ef57fd0702]
--- /opt/ttforge-toolchain/venv/bin/python(+0x1984d1) [0x55ef57fee4d1]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x5632) [0x55ef57fd0702]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyObject_FastCallDictTstate+0x16d) [0x55ef57fd661d]
--- /opt/ttforge-toolchain/venv/bin/python(_PyObject_Call_Prepend+0x5c) [0x55ef57feb62c]
--- /opt/ttforge-toolchain/venv/bin/python(+0x29d464) [0x55ef580f3464]
--- /opt/ttforge-toolchain/venv/bin/python(_PyObject_MakeTpCall+0x25b) [0x55ef57fd739b]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x68ce) [0x55ef57fd199e]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2b60) [0x55ef57fcdc30]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x18db) [0x55ef57fcc9ab]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x5632) [0x55ef57fd0702]
--- /opt/ttforge-toolchain/venv/bin/python(+0x1984d1) [0x55ef57fee4d1]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x5632) [0x55ef57fd0702]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyObject_FastCallDictTstate+0x16d) [0x55ef57fd661d]
--- /opt/ttforge-toolchain/venv/bin/python(_PyObject_Call_Prepend+0x5c) [0x55ef57feb62c]
--- /opt/ttforge-toolchain/venv/bin/python(+0x29d464) [0x55ef580f3464]
--- /opt/ttforge-toolchain/venv/bin/python(_PyObject_MakeTpCall+0x25b) [0x55ef57fd739b]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x68ce) [0x55ef57fd199e]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x6c0) [0x55ef57fcb790]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x6c0) [0x55ef57fcb790]
Raw output
record_forge_property = <function record_property.<locals>.append_property at 0x7fe45ffd7640>
@pytest.mark.nightly
def test_googlenet_pytorch(record_forge_property):
# Build Module Name
module_name = build_module_name(
framework=Framework.PYTORCH, model="googlenet", source=Source.TORCHVISION, task=Task.IMAGE_CLASSIFICATION
)
# Record Forge Property
record_forge_property("model_name", module_name)
# Create Forge module from PyTorch model
# Two ways to load the same model
# model = torch.hub.load('pytorch/vision:v0.10.0', 'googlenet', pretrained=True)
framework_model = download_model(models.googlenet, pretrained=True)
framework_model.eval()
# Image preprocessing
try:
torch.hub.download_url_to_file("https://github.com/pytorch/hub/raw/master/images/dog.jpg", "dog.jpg")
input_image = Image.open("dog.jpg")
preprocess = transforms.Compose(
[
transforms.Resize(256),
transforms.CenterCrop(224),
transforms.ToTensor(),
transforms.Normalize(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225]),
]
)
input_tensor = preprocess(input_image)
input_batch = input_tensor.unsqueeze(0) # create a mini-batch as expected by the model
except:
logger.warning(
"Failed to download the image file, replacing input with random tensor. Please check if the URL is up to date"
)
input_batch = torch.rand(1, 3, 224, 224)
inputs = [input_batch]
# Forge compile framework model
compiled_model = forge.compile(framework_model, sample_inputs=inputs, module_name=module_name)
# Model Verification
> verify(inputs, framework_model, compiled_model)
forge/test/models/pytorch/vision/googlenet/test_googlenet.py:59:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
forge/forge/verify/verify.py:302: in verify
co_out = compiled_model(*inputs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <forge.compiled_graph_state.CompiledModel object at 0x7fe54bc46560>
inputs = (tensor([[[[-1.92953, -1.92953, -1.91241, ..., -2.03228, -1.94666, -1.92953],
[-1.99803, -1.89528, -1.91241... ..., -0.95041, -1.49072, -1.38614],
[-1.28157, -1.42100, -1.22928, ..., -0.74126, -1.12471, -1.28157]]]]),)
inputs_and_parameters = [tensor([[[[-1.92953, -1.92953, -1.91241, ..., -2.03228, -1.94666, -1.92953],
[-1.99803, -1.89528, -1.91241...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 = [*to_pt_tensors(inputs)]
inputs_and_parameters = [
*self.inputs,
*self.fwd_compiled_graph_state.get_ordered_constant_tensors(),
*self.fwd_compiled_graph_state.get_ordered_parameter_tensors(),
]
assert all(
[isinstance(t, torch.Tensor) for t in inputs_and_parameters]
), "All inputs should be torch tensors by now."
if self.training() and isinstance(self.framework_module, PyTorchModule):
for name, param in self.framework_module.module.named_parameters():
if param.requires_grad:
our_tensor = self.fwd_compiled_graph_state.get_parameter_tensor(name)
# NOTE: for parameters that require gradients, we want to share the same tensor with the PyTorch
# module. This is because we want to be able to optimize the parameters both on the device
# (through our runtime) and via the torch optimizers. So this ensures that whichever side updates
# the parameter value, the other side can see the change.
#
# This could change in the future, but for now ensure that our premise is correct.
assert param is our_tensor
logger.info(
f"Running model {self.framework_module.get_name()} {self.fwd_compiled_graph_state.graph.get_name()} on device..."
)
> all_outputs = run_binary(self.compiled_binary, int(ProgramId.FORWARD), inputs_and_parameters)
E RuntimeError: TT_FATAL @ /__w/tt-forge-fe/tt-forge-fe/third_party/tt-mlir/third_party/tt-metal/src/tt-metal/ttnn/cpp/ttnn/tensor/tensor_utils.cpp:50: new_volume == old_volume
E info:
E Invalid arguments to reshape
E backtrace:
E --- /__w/tt-forge-fe/tt-forge-fe/third_party/tt-mlir/build/lib/SharedLib/libTTMLIR.so(+0x6a8bf8) [0x7fe4a6606bf8]
E --- tt::tt_metal::infer_dims_for_reshape(tt::tt_metal::Tensor const&, tt::stl::Span<int const, 18446744073709551615ul>)
E --- ttnn::operations::data_movement::ReshapeViewOperation::invoke(tt::tt_metal::Tensor const&, tt::stl::Span<int const, 18446744073709551615ul>)
E --- /__w/tt-forge-fe/tt-forge-fe/third_party/tt-mlir/build/lib/SharedLib/libTTMLIR.so(+0x78fb0b) [0x7fe4a66edb0b]
E --- tt::runtime::ttnn::operations::data_movement::run(tt::target::ttnn::ReshapeOp const*, tt::runtime::ttnn::ProgramContext&)
E --- tt::runtime::ttnn::runProgram(tt::tt_metal::distributed::MeshDevice&, tt::runtime::Binary, unsigned int, std::vector<tt::tt_metal::Tensor*, std::allocator<tt::tt_metal::Tensor*> > const&)
E --- tt::runtime::ttnn::submit(tt::runtime::Device, tt::runtime::Binary, unsigned int, std::vector<tt::runtime::Tensor, std::allocator<tt::runtime::Tensor> > const&)
E --- tt::runtime::submit(tt::runtime::Device, tt::runtime::Binary, unsigned int, std::vector<tt::runtime::Tensor, std::allocator<tt::runtime::Tensor> > const&)
E --- tt::run_binary(tt::runtime::Binary&, int, std::vector<at::Tensor, std::allocator<at::Tensor> > const&)
E --- /__w/tt-forge-fe/tt-forge-fe/forge/forge/_C.so(+0x3174e0) [0x7fe4b2e464e0]
E --- /__w/tt-forge-fe/tt-forge-fe/forge/forge/_C.so(+0x31742e) [0x7fe4b2e4642e]
E --- /__w/tt-forge-fe/tt-forge-fe/forge/forge/_C.so(+0xe0cf5) [0x7fe4b2c0fcf5]
E --- /opt/ttforge-toolchain/venv/bin/python(+0x18ab32) [0x55ef57fe0b32]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_MakeTpCall+0x25b) [0x55ef57fd739b]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x59c7) [0x55ef57fd0a97]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_FastCallDictTstate+0xc4) [0x55ef57fd6574]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_Call_Prepend+0x5c) [0x55ef57feb62c]
E --- /opt/ttforge-toolchain/venv/bin/python(+0x29d464) [0x55ef580f3464]
E --- /opt/ttforge-toolchain/venv/bin/python(PyObject_Call+0xbb) [0x55ef57fef10b]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2b60) [0x55ef57fcdc30]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x6c0) [0x55ef57fcb790]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
E --- /opt/ttforge-toolchain/venv/bin/python(PyObject_Call+0x122) [0x55ef57fef172]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2b60) [0x55ef57fcdc30]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2b60) [0x55ef57fcdc30]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x18db) [0x55ef57fcc9ab]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x5632) [0x55ef57fd0702]
E --- /opt/ttforge-toolchain/venv/bin/python(+0x1984d1) [0x55ef57fee4d1]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x5632) [0x55ef57fd0702]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_FastCallDictTstate+0x16d) [0x55ef57fd661d]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_Call_Prepend+0x5c) [0x55ef57feb62c]
E --- /opt/ttforge-toolchain/venv/bin/python(+0x29d464) [0x55ef580f3464]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_MakeTpCall+0x25b) [0x55ef57fd739b]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x68ce) [0x55ef57fd199e]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x8af) [0x55ef57fcb97f]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2b60) [0x55ef57fcdc30]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x18db) [0x55ef57fcc9ab]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x5632) [0x55ef57fd0702]
E --- /opt/ttforge-toolchain/venv/bin/python(+0x1984d1) [0x55ef57fee4d1]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x5632) [0x55ef57fd0702]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_FastCallDictTstate+0x16d) [0x55ef57fd661d]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_Call_Prepend+0x5c) [0x55ef57feb62c]
E --- /opt/ttforge-toolchain/venv/bin/python(+0x29d464) [0x55ef580f3464]
E --- /opt/ttforge-toolchain/venv/bin/python(PyObject_Call+0xbb) [0x55ef57fef10b]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2b60) [0x55ef57fcdc30]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x6c0) [0x55ef57fcb790]
E --- /opt/ttforge-toolchain/venv/bin/python(+0x1984d1) [0x55ef57fee4d1]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x18db) [0x55ef57fcc9ab]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2b60) [0x55ef57fcdc30]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x6c0) [0x55ef57fcb790]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x18db) [0x55ef57fcc9ab]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2b60) [0x55ef57fcdc30]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x18db) [0x55ef57fcc9ab]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x5632) [0x55ef57fd0702]
E --- /opt/ttforge-toolchain/venv/bin/python(+0x1984d1) [0x55ef57fee4d1]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x5632) [0x55ef57fd0702]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_FastCallDictTstate+0x16d) [0x55ef57fd661d]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_Call_Prepend+0x5c) [0x55ef57feb62c]
E --- /opt/ttforge-toolchain/venv/bin/python(+0x29d464) [0x55ef580f3464]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_MakeTpCall+0x25b) [0x55ef57fd739b]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x68ce) [0x55ef57fd199e]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2b60) [0x55ef57fcdc30]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x18db) [0x55ef57fcc9ab]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x5632) [0x55ef57fd0702]
E --- /opt/ttforge-toolchain/venv/bin/python(+0x1984d1) [0x55ef57fee4d1]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x5632) [0x55ef57fd0702]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_FastCallDictTstate+0x16d) [0x55ef57fd661d]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_Call_Prepend+0x5c) [0x55ef57feb62c]
E --- /opt/ttforge-toolchain/venv/bin/python(+0x29d464) [0x55ef580f3464]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_MakeTpCall+0x25b) [0x55ef57fd739b]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x68ce) [0x55ef57fd199e]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x6c0) [0x55ef57fcb790]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x6c0) [0x55ef57fcb790]
forge/forge/compiled_graph_state.py:253: RuntimeError
Check failure on line 96 in forge/test/models/pytorch/vision/hrnet/test_hrnet.py
github-actions / TT-Forge-FE Tests
test_hrnet.test_hrnet_osmr_pytorch[hrnet_w18_small_v1]
RuntimeError: Found Unsupported operations while lowering from TTForge to TTIR in forward graph
Raw output
record_forge_property = <function record_property.<locals>.append_property at 0x7fe4560c7f40>
variant = 'hrnet_w18_small_v1'
@pytest.mark.nightly
@pytest.mark.parametrize("variant", variants, ids=variants)
def test_hrnet_osmr_pytorch(record_forge_property, variant):
if variant != "hrnet_w18_small_v1":
pytest.skip("Skipping due to the current CI/CD pipeline limitations")
# Build Module Name
module_name = build_module_name(
framework=Framework.PYTORCH, model="hrnet", variant=variant, source=Source.OSMR, task=Task.POSE_ESTIMATION
)
# Record Forge Property
record_forge_property("model_name", module_name)
framework_model, inputs, _ = generate_model_hrnet_imgcls_osmr_pytorch(
variant,
)
# Forge compile framework model
> compiled_model = forge.compile(framework_model, sample_inputs=inputs, module_name=module_name)
forge/test/models/pytorch/vision/hrnet/test_hrnet.py:96:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
forge/forge/compile.py:253: in compile_main
return forge_compile_from_context(compile_context)
forge/forge/compile.py:295: in forge_compile_from_context
next_stage = stage_to_func[current_stage](context)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
context = CompileContext(modules=[Module pt_hrnet_hrnet_w18_small_v1_pose_estimation_osmr], graph_name='pt_hrnet_hrnet_w18_small...cles_offset=0, forge_module=<forge._C.ForgeGraphModule object at 0x7fe3c06977b0>, compiled_binary=None, attach_to=None)
def run_mlir_compiler(context: CompileContext) -> CompileDepth:
assert context.forge_module is not None
> context.compiled_binary = forge._C.run_mlir_compiler(context.forge_module)
E RuntimeError: Found Unsupported operations while lowering from TTForge to TTIR in forward graph
forge/forge/compile.py:976: RuntimeError
Check failure on line 52 in forge/test/models/pytorch/vision/mlp_mixer/test_mlp_mixer.py
github-actions / TT-Forge-FE Tests
test_mlp_mixer.test_mlp_mixer_timm_pytorch[mixer_b16_224]
NameError: name 'model' is not defined
Raw output
record_forge_property = <function record_property.<locals>.append_property at 0x7fe45fa991b0>
variant = 'mixer_b16_224'
@pytest.mark.nightly
@pytest.mark.parametrize("variant", varaints, ids=varaints)
def test_mlp_mixer_timm_pytorch(record_forge_property, variant):
if variant != "mixer_b16_224":
pytest.skip("Skipping due to the current CI/CD pipeline limitations")
# Build Module Name
module_name = build_module_name(
framework=Framework.PYTORCH,
model="mlp_mixer",
variant=variant,
source=Source.TIMM,
task=Task.IMAGE_CLASSIFICATION,
)
# Record Forge Property
record_forge_property("model_name", module_name)
framework_model = download_model(timm.create_model, variant, pretrained=True)
> config = resolve_data_config({}, model=model)
E NameError: name 'model' is not defined
forge/test/models/pytorch/vision/mlp_mixer/test_mlp_mixer.py:52: NameError
Check failure on line 47 in forge/test/models/pytorch/vision/monodle/test_monodle.py
github-actions / TT-Forge-FE Tests
test_monodle.test_monodle_pytorch
RuntimeError: Found Unsupported operations while lowering from TTForge to TTIR in forward graph
Raw output
record_forge_property = <function record_property.<locals>.append_property at 0x7fe54cf749d0>
@pytest.mark.nightly
def test_monodle_pytorch(record_forge_property):
# Build Module Name
module_name = build_module_name(
framework=Framework.PYTORCH, model="monodle", source=Source.TORCHVISION, task=Task.OBJECT_DETECTION
)
# Record Forge Property
record_forge_property("model_name", module_name)
# Load data sample
url = "https://images.rawpixel.com/image_1300/cHJpdmF0ZS9sci9pbWFnZXMvd2Vic2l0ZS8yMDIyLTA1L3BkMTA2LTA0Ny1jaGltXzEuanBn.jpg"
image = Image.open(requests.get(url, stream=True).raw)
# Preprocessing
transform = transforms.Compose(
[
transforms.Resize(256),
transforms.CenterCrop(224),
transforms.ToTensor(),
transforms.Normalize(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225]),
]
)
img_tensor = transform(image).unsqueeze(0)
framework_model = CenterNet3D(backbone="dla34")
framework_model.eval()
inputs = [img_tensor]
# Forge compile framework model
> compiled_model = forge.compile(framework_model, sample_inputs=inputs, module_name=module_name)
forge/test/models/pytorch/vision/monodle/test_monodle.py:47:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
forge/forge/compile.py:253: in compile_main
return forge_compile_from_context(compile_context)
forge/forge/compile.py:295: in forge_compile_from_context
next_stage = stage_to_func[current_stage](context)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
context = CompileContext(modules=[Module pt_monodle_base_obj_det_torchvision], graph_name='pt_monodle_base_obj_det_torchvision',...cles_offset=0, forge_module=<forge._C.ForgeGraphModule object at 0x7fe4667c3070>, compiled_binary=None, attach_to=None)
def run_mlir_compiler(context: CompileContext) -> CompileDepth:
assert context.forge_module is not None
> context.compiled_binary = forge._C.run_mlir_compiler(context.forge_module)
E RuntimeError: Found Unsupported operations while lowering from TTForge to TTIR in forward graph
forge/forge/compile.py:976: RuntimeError
Check failure on line 40 in forge/test/models/pytorch/vision/regnet/test_regnet.py
github-actions / TT-Forge-FE Tests
test_regnet.test_regnet[facebook/regnet-y-040]
RuntimeError: Unknown type of tensor: <class 'transformers.modeling_outputs.BaseModelOutputWithPoolingAndNoAttention'>
Raw output
record_forge_property = <function record_property.<locals>.append_property at 0x7fe45af44430>
variant = 'facebook/regnet-y-040'
@pytest.mark.nightly
@pytest.mark.parametrize("variant", ["facebook/regnet-y-040"])
def test_regnet(record_forge_property, variant):
# Build Module Name
module_name = build_module_name(
framework=Framework.PYTORCH,
model="regnet",
variant=variant,
source=Source.HUGGINGFACE,
task=Task.IMAGE_CLASSIFICATION,
)
# Record Forge Property
record_forge_property("model_name", module_name)
# Load RegNet model
framework_model = RegNetModel.from_pretrained("facebook/regnet-y-040")
# Preprocess the image
image_url = "http://images.cocodataset.org/val2017/000000039769.jpg"
inputs = preprocess_input_data(image_url, variant)
# Forge compile framework model
compiled_model = forge.compile(framework_model, sample_inputs=inputs, module_name=module_name)
# Model Verification
> verify(inputs, framework_model, compiled_model)
forge/test/models/pytorch/vision/regnet/test_regnet.py:40:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
forge/forge/verify/verify.py:306: in verify
fw_out = to_pt_tensors(fw_out)
forge/forge/tensor.py:1145: in to_pt_tensors
pytorch_tensors.append(to_pt_tensor(t))
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
t = BaseModelOutputWithPoolingAndNoAttention(last_hidden_state=tensor([[[[0.00000, 0.00000, 0.00000, ..., 0.00000, 0.0000....,
[[0.46296]],
[[0.45180]],
[[0.66460]]]], grad_fn=<MeanBackward1>), hidden_states=None)
def to_pt_tensor(t: AnyTensor) -> torch.Tensor:
if isinstance(t, torch.Tensor):
return t
elif isinstance(t, (tf.Tensor, tf.Variable)):
pt = torch.Tensor(t.numpy() if t.dtype != tf.bfloat16 else tf.cast(t, tf.float32).numpy()).type(
map_tf_dtype_to_pt(t.dtype)
)
pt.requires_grad = (
t.trainable if isinstance(t, tf.Variable) else torch.is_complex(pt) or torch.is_floating_point(pt)
)
return pt
elif isinstance(t, Tensor):
assert t.has_value(), "Expected Forge tensor to have a value"
return t.value()
else:
> raise RuntimeError(f"Unknown type of tensor: {type(t)}")
E RuntimeError: Unknown type of tensor: <class 'transformers.modeling_outputs.BaseModelOutputWithPoolingAndNoAttention'>
forge/forge/tensor.py:1165: RuntimeError
Check failure on line 40 in forge/test/models/pytorch/vision/swin/test_swin.py
github-actions / TT-Forge-FE Tests
test_swin.test_swin_v1_tiny_4_224_hf_pytorch[microsoft/swin-tiny-patch4-window7-224]
RuntimeError: Unknown model (swin-tiny-patch4-window7-224)
Raw output
record_forge_property = <function record_property.<locals>.append_property at 0x7fe3c04e1b40>
variant = 'microsoft/swin-tiny-patch4-window7-224'
@pytest.mark.nightly
@pytest.mark.parametrize("variant", ["microsoft/swin-tiny-patch4-window7-224"])
def test_swin_v1_tiny_4_224_hf_pytorch(record_forge_property, variant):
# Build Module Name
module_name = build_module_name(
framework=Framework.PYTORCH,
model="swin",
variant=variant,
source=Source.HUGGINGFACE,
task=Task.IMAGE_CLASSIFICATION,
)
# Record Forge Property
record_forge_property("model_name", module_name)
# STEP 1: Create Forge module from PyTorch model
feature_extractor = ViTImageProcessor.from_pretrained(variant)
# model = SwinForImageClassification.from_pretrained("microsoft/swin-tiny-patch4-window7-224", torchscript=True)
> framework_model = download_model(timm.create_model, variant, pretrained=True)
forge/test/models/pytorch/vision/swin/test_swin.py:40:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
forge/test/utils.py:15: in download_model
return download_func(*args, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
model_name = 'swin-tiny-patch4-window7-224', pretrained = True
pretrained_cfg = None, checkpoint_path = '', scriptable = None
exportable = None, no_jit = None, kwargs = {}, model_source = 'timm'
def create_model(
model_name,
pretrained=False,
pretrained_cfg=None,
checkpoint_path='',
scriptable=None,
exportable=None,
no_jit=None,
**kwargs):
"""Create a model
Args:
model_name (str): name of model to instantiate
pretrained (bool): load pretrained ImageNet-1k weights if true
checkpoint_path (str): path of checkpoint to load after model is initialized
scriptable (bool): set layer config so that model is jit scriptable (not working for all models yet)
exportable (bool): set layer config so that model is traceable / ONNX exportable (not fully impl/obeyed yet)
no_jit (bool): set layer config so that model doesn't utilize jit scripted layers (so far activations only)
Keyword Args:
drop_rate (float): dropout rate for training (default: 0.0)
global_pool (str): global pool type (default: 'avg')
**: other kwargs are model specific
"""
# Parameters that aren't supported by all models or are intended to only override model defaults if set
# should default to None in command line args/cfg. Remove them if they are present and not set so that
# non-supporting models don't break and default args remain in effect.
kwargs = {k: v for k, v in kwargs.items() if v is not None}
model_source, model_name = parse_model_name(model_name)
if model_source == 'hf-hub':
# FIXME hf-hub source overrides any passed in pretrained_cfg, warn?
# For model names specified in the form `hf-hub:path/architecture_name@revision`,
# load model weights + pretrained_cfg from Hugging Face hub.
pretrained_cfg, model_name = load_model_config_from_hf(model_name)
if not is_model(model_name):
> raise RuntimeError('Unknown model (%s)' % model_name)
E RuntimeError: Unknown model (swin-tiny-patch4-window7-224)
/opt/ttforge-toolchain/venv/lib/python3.10/site-packages/timm/models/factory.py:67: RuntimeError
Check failure on line 53 in forge/test/models/pytorch/vision/unet/test_unet.py
github-actions / TT-Forge-FE Tests
test_unet.test_unet_osmr_cityscape_pytorch
RuntimeError: Found Unsupported operations while lowering from TTForge to TTIR in forward graph
Raw output
record_forge_property = <function record_property.<locals>.append_property at 0x7fe3c04e2200>
@pytest.mark.nightly
def test_unet_osmr_cityscape_pytorch(record_forge_property):
# Build Module Name
module_name = build_module_name(
framework=Framework.PYTORCH, model="unet", variant="cityscape", source=Source.OSMR, task=Task.IMAGE_SEGMENTATION
)
# Record Forge Property
record_forge_property("model_name", module_name)
framework_model, inputs, _ = generate_model_unet_imgseg_osmr_pytorch("unet_cityscapes")
# Forge compile framework model
> compiled_model = forge.compile(framework_model, sample_inputs=inputs, module_name=module_name)
forge/test/models/pytorch/vision/unet/test_unet.py:53:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
forge/forge/compile.py:253: in compile_main
return forge_compile_from_context(compile_context)
forge/forge/compile.py:295: in forge_compile_from_context
next_stage = stage_to_func[current_stage](context)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
context = CompileContext(modules=[Module pt_unet_cityscape_img_seg_osmr], graph_name='pt_unet_cityscape_img_seg_osmr', compiler_...cles_offset=0, forge_module=<forge._C.ForgeGraphModule object at 0x7fe54c03ac30>, compiled_binary=None, attach_to=None)
def run_mlir_compiler(context: CompileContext) -> CompileDepth:
assert context.forge_module is not None
> context.compiled_binary = forge._C.run_mlir_compiler(context.forge_module)
E RuntimeError: Found Unsupported operations while lowering from TTForge to TTIR in forward graph
forge/forge/compile.py:976: RuntimeError
Check failure on line 66 in forge/test/models/pytorch/vision/vgg/test_vgg.py
github-actions / TT-Forge-FE Tests
test_vgg.test_vgg_osmr_pytorch[vgg11]
RuntimeError: Failed to run MLIR compiler pass pipeline.
Raw output
record_forge_property = <function record_property.<locals>.append_property at 0x7fe54cc62170>
variant = 'vgg11'
@pytest.mark.nightly
@pytest.mark.parametrize("variant", variants)
def test_vgg_osmr_pytorch(record_forge_property, variant):
if variant != "vgg11":
pytest.skip("Skipping due to the current CI/CD pipeline limitations")
# Build Module Name
module_name = build_module_name(
framework=Framework.PYTORCH, model="vgg", variant=variant, source=Source.OSMR, task=Task.OBJECT_DETECTION
)
# Record Forge Property
record_forge_property("model_name", module_name)
framework_model = download_model(ptcv_get_model, variant, pretrained=True)
framework_model.eval()
# Image preprocessing
try:
torch.hub.download_url_to_file("https://github.com/pytorch/hub/raw/master/images/dog.jpg", "dog.jpg")
input_image = Image.open("dog.jpg")
preprocess = transforms.Compose(
[
transforms.Resize(256),
transforms.CenterCrop(224),
transforms.ToTensor(),
transforms.Normalize(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225]),
]
)
input_tensor = preprocess(input_image)
input_batch = input_tensor.unsqueeze(0) # create a mini-batch as expected by the model
except:
logger.warning(
"Failed to download the image file, replacing input with random tensor. Please check if the URL is up to date"
)
input_batch = torch.rand(1, 3, 224, 224)
inputs = [input_batch]
# Forge compile framework model
> compiled_model = forge.compile(framework_model, sample_inputs=inputs, module_name=module_name)
forge/test/models/pytorch/vision/vgg/test_vgg.py:66:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
forge/forge/compile.py:253: in compile_main
return forge_compile_from_context(compile_context)
forge/forge/compile.py:295: in forge_compile_from_context
next_stage = stage_to_func[current_stage](context)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
context = CompileContext(modules=[Module pt_vgg_vgg11_obj_det_osmr], graph_name='pt_vgg_vgg11_obj_det_osmr', compiler_cfg=Compil...cles_offset=0, forge_module=<forge._C.ForgeGraphModule object at 0x7fe45a6ffa30>, compiled_binary=None, attach_to=None)
def run_mlir_compiler(context: CompileContext) -> CompileDepth:
assert context.forge_module is not None
> context.compiled_binary = forge._C.run_mlir_compiler(context.forge_module)
E RuntimeError: Failed to run MLIR compiler pass pipeline.
forge/forge/compile.py:976: RuntimeError
Check failure on line 51 in forge/test/models/pytorch/vision/vovnet/test_vovnet.py
github-actions / TT-Forge-FE Tests
test_vovnet.test_vovnet_osmr_pytorch[vovnet27s]
RuntimeError: TT_FATAL @ /__w/tt-forge-fe/tt-forge-fe/third_party/tt-mlir/third_party/tt-metal/src/tt-metal/ttnn/cpp/ttnn/tensor/tensor_utils.cpp:50: new_volume == old_volume
info:
Invalid arguments to reshape
backtrace:
--- /__w/tt-forge-fe/tt-forge-fe/third_party/tt-mlir/build/lib/SharedLib/libTTMLIR.so(+0x6a8bf8) [0x7fe4a6606bf8]
--- tt::tt_metal::infer_dims_for_reshape(tt::tt_metal::Tensor const&, tt::stl::Span<int const, 18446744073709551615ul>)
--- ttnn::operations::data_movement::ReshapeViewOperation::invoke(tt::tt_metal::Tensor const&, tt::stl::Span<int const, 18446744073709551615ul>)
--- /__w/tt-forge-fe/tt-forge-fe/third_party/tt-mlir/build/lib/SharedLib/libTTMLIR.so(+0x78fb0b) [0x7fe4a66edb0b]
--- tt::runtime::ttnn::operations::data_movement::run(tt::target::ttnn::ReshapeOp const*, tt::runtime::ttnn::ProgramContext&)
--- tt::runtime::ttnn::runProgram(tt::tt_metal::distributed::MeshDevice&, tt::runtime::Binary, unsigned int, std::vector<tt::tt_metal::Tensor*, std::allocator<tt::tt_metal::Tensor*> > const&)
--- tt::runtime::ttnn::submit(tt::runtime::Device, tt::runtime::Binary, unsigned int, std::vector<tt::runtime::Tensor, std::allocator<tt::runtime::Tensor> > const&)
--- tt::runtime::submit(tt::runtime::Device, tt::runtime::Binary, unsigned int, std::vector<tt::runtime::Tensor, std::allocator<tt::runtime::Tensor> > const&)
--- tt::run_binary(tt::runtime::Binary&, int, std::vector<at::Tensor, std::allocator<at::Tensor> > const&)
--- /__w/tt-forge-fe/tt-forge-fe/forge/forge/_C.so(+0x3174e0) [0x7fe4b2e464e0]
--- /__w/tt-forge-fe/tt-forge-fe/forge/forge/_C.so(+0x31742e) [0x7fe4b2e4642e]
--- /__w/tt-forge-fe/tt-forge-fe/forge/forge/_C.so(+0xe0cf5) [0x7fe4b2c0fcf5]
--- /opt/ttforge-toolchain/venv/bin/python(+0x18ab32) [0x55ef57fe0b32]
--- /opt/ttforge-toolchain/venv/bin/python(_PyObject_MakeTpCall+0x25b) [0x55ef57fd739b]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x59c7) [0x55ef57fd0a97]
--- /opt/ttforge-toolchain/venv/bin/python(_PyObject_FastCallDictTstate+0xc4) [0x55ef57fd6574]
--- /opt/ttforge-toolchain/venv/bin/python(_PyObject_Call_Prepend+0x5c) [0x55ef57feb62c]
--- /opt/ttforge-toolchain/venv/bin/python(+0x29d464) [0x55ef580f3464]
--- /opt/ttforge-toolchain/venv/bin/python(PyObject_Call+0xbb) [0x55ef57fef10b]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2b60) [0x55ef57fcdc30]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x6c0) [0x55ef57fcb790]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
--- /opt/ttforge-toolchain/venv/bin/python(PyObject_Call+0x122) [0x55ef57fef172]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2b60) [0x55ef57fcdc30]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2b60) [0x55ef57fcdc30]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x18db) [0x55ef57fcc9ab]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x5632) [0x55ef57fd0702]
--- /opt/ttforge-toolchain/venv/bin/python(+0x1984d1) [0x55ef57fee4d1]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x5632) [0x55ef57fd0702]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyObject_FastCallDictTstate+0x16d) [0x55ef57fd661d]
--- /opt/ttforge-toolchain/venv/bin/python(_PyObject_Call_Prepend+0x5c) [0x55ef57feb62c]
--- /opt/ttforge-toolchain/venv/bin/python(+0x29d464) [0x55ef580f3464]
--- /opt/ttforge-toolchain/venv/bin/python(_PyObject_MakeTpCall+0x25b) [0x55ef57fd739b]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x68ce) [0x55ef57fd199e]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x8af) [0x55ef57fcb97f]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2b60) [0x55ef57fcdc30]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x18db) [0x55ef57fcc9ab]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x5632) [0x55ef57fd0702]
--- /opt/ttforge-toolchain/venv/bin/python(+0x1984d1) [0x55ef57fee4d1]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x5632) [0x55ef57fd0702]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyObject_FastCallDictTstate+0x16d) [0x55ef57fd661d]
--- /opt/ttforge-toolchain/venv/bin/python(_PyObject_Call_Prepend+0x5c) [0x55ef57feb62c]
--- /opt/ttforge-toolchain/venv/bin/python(+0x29d464) [0x55ef580f3464]
--- /opt/ttforge-toolchain/venv/bin/python(PyObject_Call+0xbb) [0x55ef57fef10b]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2b60) [0x55ef57fcdc30]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x6c0) [0x55ef57fcb790]
--- /opt/ttforge-toolchain/venv/bin/python(+0x1984d1) [0x55ef57fee4d1]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x18db) [0x55ef57fcc9ab]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2b60) [0x55ef57fcdc30]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x6c0) [0x55ef57fcb790]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x18db) [0x55ef57fcc9ab]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2b60) [0x55ef57fcdc30]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x18db) [0x55ef57fcc9ab]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x5632) [0x55ef57fd0702]
--- /opt/ttforge-toolchain/venv/bin/python(+0x1984d1) [0x55ef57fee4d1]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x5632) [0x55ef57fd0702]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyObject_FastCallDictTstate+0x16d) [0x55ef57fd661d]
--- /opt/ttforge-toolchain/venv/bin/python(_PyObject_Call_Prepend+0x5c) [0x55ef57feb62c]
--- /opt/ttforge-toolchain/venv/bin/python(+0x29d464) [0x55ef580f3464]
--- /opt/ttforge-toolchain/venv/bin/python(_PyObject_MakeTpCall+0x25b) [0x55ef57fd739b]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x68ce) [0x55ef57fd199e]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2b60) [0x55ef57fcdc30]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x18db) [0x55ef57fcc9ab]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x5632) [0x55ef57fd0702]
--- /opt/ttforge-toolchain/venv/bin/python(+0x1984d1) [0x55ef57fee4d1]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x5632) [0x55ef57fd0702]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyObject_FastCallDictTstate+0x16d) [0x55ef57fd661d]
--- /opt/ttforge-toolchain/venv/bin/python(_PyObject_Call_Prepend+0x5c) [0x55ef57feb62c]
--- /opt/ttforge-toolchain/venv/bin/python(+0x29d464) [0x55ef580f3464]
--- /opt/ttforge-toolchain/venv/bin/python(_PyObject_MakeTpCall+0x25b) [0x55ef57fd739b]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x68ce) [0x55ef57fd199e]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x6c0) [0x55ef57fcb790]
--- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
--- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x6c0) [0x55ef57fcb790]
Raw output
record_forge_property = <function record_property.<locals>.append_property at 0x7fe45aab35b0>
variant = 'vovnet27s'
@pytest.mark.nightly
@pytest.mark.parametrize("variant", varaints, ids=varaints)
def test_vovnet_osmr_pytorch(record_forge_property, variant):
if variant != "vovnet27s":
pytest.skip("Skipping due to the current CI/CD pipeline limitations")
# Build Module Name
module_name = build_module_name(
framework=Framework.PYTORCH, model="vovnet", variant=variant, source=Source.OSMR, task=Task.OBJECT_DETECTION
)
# Record Forge Property
record_forge_property("model_name", module_name)
framework_model, inputs, _ = generate_model_vovnet_imgcls_osmr_pytorch(variant)
# Forge compile framework model
compiled_model = forge.compile(framework_model, sample_inputs=inputs, module_name=module_name)
# Model Verification
> verify(inputs, framework_model, compiled_model)
forge/test/models/pytorch/vision/vovnet/test_vovnet.py:51:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
forge/forge/verify/verify.py:302: in verify
co_out = compiled_model(*inputs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <forge.compiled_graph_state.CompiledModel object at 0x7fe45f9c38b0>
inputs = (tensor([[[[-1.92953, -1.92953, -1.91241, ..., -2.03228, -1.94666, -1.92953],
[-1.99803, -1.89528, -1.91241... ..., -0.95041, -1.49072, -1.38614],
[-1.28157, -1.42100, -1.22928, ..., -0.74126, -1.12471, -1.28157]]]]),)
inputs_and_parameters = [tensor([[[[-1.92953, -1.92953, -1.91241, ..., -2.03228, -1.94666, -1.92953],
[-1.99803, -1.89528, -1.91241...1.48491, 0.82613, 0.95755, 0.84748, 0.71070, 0.72036, 1.10198, 0.52548, 1.24055, 0.97474]]]], requires_grad=True), ...]
def __call__(self, *inputs: AnyTensor) -> List[torch.Tensor]:
"""
Run inference on the compiled model.
Parameters
----------
inputs: [Tensor, ...]
Input tensors
Returns
-------
List[Tensor]
Output tensors
"""
self.inputs = [*to_pt_tensors(inputs)]
inputs_and_parameters = [
*self.inputs,
*self.fwd_compiled_graph_state.get_ordered_constant_tensors(),
*self.fwd_compiled_graph_state.get_ordered_parameter_tensors(),
]
assert all(
[isinstance(t, torch.Tensor) for t in inputs_and_parameters]
), "All inputs should be torch tensors by now."
if self.training() and isinstance(self.framework_module, PyTorchModule):
for name, param in self.framework_module.module.named_parameters():
if param.requires_grad:
our_tensor = self.fwd_compiled_graph_state.get_parameter_tensor(name)
# NOTE: for parameters that require gradients, we want to share the same tensor with the PyTorch
# module. This is because we want to be able to optimize the parameters both on the device
# (through our runtime) and via the torch optimizers. So this ensures that whichever side updates
# the parameter value, the other side can see the change.
#
# This could change in the future, but for now ensure that our premise is correct.
assert param is our_tensor
logger.info(
f"Running model {self.framework_module.get_name()} {self.fwd_compiled_graph_state.graph.get_name()} on device..."
)
> all_outputs = run_binary(self.compiled_binary, int(ProgramId.FORWARD), inputs_and_parameters)
E RuntimeError: TT_FATAL @ /__w/tt-forge-fe/tt-forge-fe/third_party/tt-mlir/third_party/tt-metal/src/tt-metal/ttnn/cpp/ttnn/tensor/tensor_utils.cpp:50: new_volume == old_volume
E info:
E Invalid arguments to reshape
E backtrace:
E --- /__w/tt-forge-fe/tt-forge-fe/third_party/tt-mlir/build/lib/SharedLib/libTTMLIR.so(+0x6a8bf8) [0x7fe4a6606bf8]
E --- tt::tt_metal::infer_dims_for_reshape(tt::tt_metal::Tensor const&, tt::stl::Span<int const, 18446744073709551615ul>)
E --- ttnn::operations::data_movement::ReshapeViewOperation::invoke(tt::tt_metal::Tensor const&, tt::stl::Span<int const, 18446744073709551615ul>)
E --- /__w/tt-forge-fe/tt-forge-fe/third_party/tt-mlir/build/lib/SharedLib/libTTMLIR.so(+0x78fb0b) [0x7fe4a66edb0b]
E --- tt::runtime::ttnn::operations::data_movement::run(tt::target::ttnn::ReshapeOp const*, tt::runtime::ttnn::ProgramContext&)
E --- tt::runtime::ttnn::runProgram(tt::tt_metal::distributed::MeshDevice&, tt::runtime::Binary, unsigned int, std::vector<tt::tt_metal::Tensor*, std::allocator<tt::tt_metal::Tensor*> > const&)
E --- tt::runtime::ttnn::submit(tt::runtime::Device, tt::runtime::Binary, unsigned int, std::vector<tt::runtime::Tensor, std::allocator<tt::runtime::Tensor> > const&)
E --- tt::runtime::submit(tt::runtime::Device, tt::runtime::Binary, unsigned int, std::vector<tt::runtime::Tensor, std::allocator<tt::runtime::Tensor> > const&)
E --- tt::run_binary(tt::runtime::Binary&, int, std::vector<at::Tensor, std::allocator<at::Tensor> > const&)
E --- /__w/tt-forge-fe/tt-forge-fe/forge/forge/_C.so(+0x3174e0) [0x7fe4b2e464e0]
E --- /__w/tt-forge-fe/tt-forge-fe/forge/forge/_C.so(+0x31742e) [0x7fe4b2e4642e]
E --- /__w/tt-forge-fe/tt-forge-fe/forge/forge/_C.so(+0xe0cf5) [0x7fe4b2c0fcf5]
E --- /opt/ttforge-toolchain/venv/bin/python(+0x18ab32) [0x55ef57fe0b32]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_MakeTpCall+0x25b) [0x55ef57fd739b]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x59c7) [0x55ef57fd0a97]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_FastCallDictTstate+0xc4) [0x55ef57fd6574]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_Call_Prepend+0x5c) [0x55ef57feb62c]
E --- /opt/ttforge-toolchain/venv/bin/python(+0x29d464) [0x55ef580f3464]
E --- /opt/ttforge-toolchain/venv/bin/python(PyObject_Call+0xbb) [0x55ef57fef10b]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2b60) [0x55ef57fcdc30]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x6c0) [0x55ef57fcb790]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
E --- /opt/ttforge-toolchain/venv/bin/python(PyObject_Call+0x122) [0x55ef57fef172]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2b60) [0x55ef57fcdc30]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2b60) [0x55ef57fcdc30]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x18db) [0x55ef57fcc9ab]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x5632) [0x55ef57fd0702]
E --- /opt/ttforge-toolchain/venv/bin/python(+0x1984d1) [0x55ef57fee4d1]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x5632) [0x55ef57fd0702]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_FastCallDictTstate+0x16d) [0x55ef57fd661d]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_Call_Prepend+0x5c) [0x55ef57feb62c]
E --- /opt/ttforge-toolchain/venv/bin/python(+0x29d464) [0x55ef580f3464]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_MakeTpCall+0x25b) [0x55ef57fd739b]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x68ce) [0x55ef57fd199e]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x8af) [0x55ef57fcb97f]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2b60) [0x55ef57fcdc30]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x18db) [0x55ef57fcc9ab]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x5632) [0x55ef57fd0702]
E --- /opt/ttforge-toolchain/venv/bin/python(+0x1984d1) [0x55ef57fee4d1]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x5632) [0x55ef57fd0702]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_FastCallDictTstate+0x16d) [0x55ef57fd661d]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_Call_Prepend+0x5c) [0x55ef57feb62c]
E --- /opt/ttforge-toolchain/venv/bin/python(+0x29d464) [0x55ef580f3464]
E --- /opt/ttforge-toolchain/venv/bin/python(PyObject_Call+0xbb) [0x55ef57fef10b]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2b60) [0x55ef57fcdc30]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x6c0) [0x55ef57fcb790]
E --- /opt/ttforge-toolchain/venv/bin/python(+0x1984d1) [0x55ef57fee4d1]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x18db) [0x55ef57fcc9ab]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2b60) [0x55ef57fcdc30]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x6c0) [0x55ef57fcb790]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x18db) [0x55ef57fcc9ab]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2b60) [0x55ef57fcdc30]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x18db) [0x55ef57fcc9ab]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x5632) [0x55ef57fd0702]
E --- /opt/ttforge-toolchain/venv/bin/python(+0x1984d1) [0x55ef57fee4d1]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x5632) [0x55ef57fd0702]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_FastCallDictTstate+0x16d) [0x55ef57fd661d]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_Call_Prepend+0x5c) [0x55ef57feb62c]
E --- /opt/ttforge-toolchain/venv/bin/python(+0x29d464) [0x55ef580f3464]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_MakeTpCall+0x25b) [0x55ef57fd739b]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x68ce) [0x55ef57fd199e]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x2b60) [0x55ef57fcdc30]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x18db) [0x55ef57fcc9ab]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x5632) [0x55ef57fd0702]
E --- /opt/ttforge-toolchain/venv/bin/python(+0x1984d1) [0x55ef57fee4d1]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x5632) [0x55ef57fd0702]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_FastCallDictTstate+0x16d) [0x55ef57fd661d]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_Call_Prepend+0x5c) [0x55ef57feb62c]
E --- /opt/ttforge-toolchain/venv/bin/python(+0x29d464) [0x55ef580f3464]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyObject_MakeTpCall+0x25b) [0x55ef57fd739b]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x68ce) [0x55ef57fd199e]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x6c0) [0x55ef57fcb790]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyFunction_Vectorcall+0x7c) [0x55ef57fe138c]
E --- /opt/ttforge-toolchain/venv/bin/python(_PyEval_EvalFrameDefault+0x6c0) [0x55ef57fcb790]
forge/forge/compiled_graph_state.py:253: RuntimeError
Check failure on line 95 in forge/test/models/onnx/vision/yolo/test_yolo_v5.py
github-actions / TT-Forge-FE Tests
test_yolo_v5.test_yolov5_640x640[yolov5s]
RuntimeError: Found Unsupported operations while lowering from TTForge to TTIR in forward graph
Raw output
record_forge_property = <function record_property.<locals>.append_property at 0x7fe45aab2050>
size = 's'
@pytest.mark.nightly
@pytest.mark.parametrize("size", size, ids=["yolov5" + s for s in size])
def test_yolov5_640x640(record_forge_property, size):
if size != "s":
pytest.skip("Skipping due to the current CI/CD pipeline limitations")
# Build Module Name
module_name = build_module_name(
framework=Framework.PYTORCH,
model="yolo_v5",
variant="yolov5" + size,
task="imgcls",
source="torchhub",
suffix="640x640",
)
# Record Forge Property
record_forge_property("model_name", module_name)
framework_model, inputs, _ = generate_model_yoloV5I640_imgcls_torchhub_pytorch(
"ultralytics/yolov5",
size=size,
)
# Forge compile framework model
> compiled_model = forge.compile(framework_model, sample_inputs=inputs, module_name=module_name)
forge/test/models/pytorch/vision/yolo/test_yolo_v5.py:95:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
forge/forge/compile.py:253: in compile_main
return forge_compile_from_context(compile_context)
forge/forge/compile.py:295: in forge_compile_from_context
next_stage = stage_to_func[current_stage](context)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
context = CompileContext(modules=[Module pt_yolo_v5_yolov5s_imgcls_torchhub_640x640], graph_name='pt_yolo_v5_yolov5s_imgcls_torc...cles_offset=0, forge_module=<forge._C.ForgeGraphModule object at 0x7fe444d8f870>, compiled_binary=None, attach_to=None)
def run_mlir_compiler(context: CompileContext) -> CompileDepth:
assert context.forge_module is not None
> context.compiled_binary = forge._C.run_mlir_compiler(context.forge_module)
E RuntimeError: Found Unsupported operations while lowering from TTForge to TTIR in forward graph
forge/forge/compile.py:976: RuntimeError