aws-neuron / aws-neuron-sdk

Powering AWS purpose-built machine learning chips. Blazing fast and cost effective, natively integrated into PyTorch and TensorFlow and integrated with your favorite AWS services
https://aws.amazon.com/machine-learning/neuron/
Other
420 stars 136 forks source link

NEFF Unable to open: kelf-b.json - 2 when loading in a model traced on 4 NeuronCores #894

Open Bartosz-G opened 1 month ago

Bartosz-G commented 1 month ago

Description

When tracing the model with compiler_args = ['--neuroncore-pipeline-cores', '4'] the tracing passes but traced model cannot be loaded back in due to the NEFF error (below). When tracing the same model without the following flag the model is correctly loaded in and runs on Inferentia core.

Code:

import os
import sys
import torch
import time
import torch.nn as nn
import torch_neuron

---- loading the model -----

img = torch.rand(1, 3, 480, 480)

with torch.no_grad():
    output = rtdetr(img)

neuron_model_path = 'rtdetr480_neuron_test.pt'

model_neuron = torch.neuron.trace(rtdetr, img, compiler_args = ['--neuroncore-pipeline-cores', '4', '--verbose', 'DEBUG']) # Causes the error
# model_neuron = torch.neuron.trace(rtdetr, img) # Runs without any issues
model_neuron.save(neuron_model_path)

# os.environ['NEURON_RT_LOG_LEVEL'] = 'WARN'
rtdetr = torch.jit.load(neuron_model_path)
img = torch.rand(1, 3, 480, 480)
# Warm-up
output = rtdetr(img)

start_time = time.perf_counter()
output = rtdetr(img)
delta = time.perf_counter() - start_time
inference_time_ms = delta * 1000
print(f'inference time: {inference_time_ms:.3f} ms')

Error When loading back the model:

2024-May-23 13:47:16.0143  3065:3065   WARN  NMGR:kmgr_load_nn_internal                   Unable to find hlo_stats.json in the NEFF
2024-May-23 13:47:16.0234  3065:3065   WARN  NMGR:kmgr_load_nn_internal                   Unable to find hlo_stats.json in the NEFF
2024-May-23 13:47:16.0313  3065:3065   WARN  NMGR:kmgr_load_nn_internal                   Unable to find hlo_stats.json in the NEFF
2024-May-23 13:47:16.0354  3065:3065   WARN  NMGR:kmgr_load_nn_internal                   Unable to find hlo_stats.json in the NEFF
2024-May-23 13:47:16.0415  3065:3065   WARN  NMGR:kmgr_load_nn_internal                   Unable to find hlo_stats.json in the NEFF
2024-May-23 13:47:16.0505  3065:3065  ERROR  NEFF:json_parse_load_elements                Unable to open: kelf-b.json - 2
2024-May-23 13:47:16.0505  3065:3065  ERROR  NEFF:kelf_load                               Failed to parse kelf-b.json
2024-May-23 13:47:16.0505  3065:3065  ERROR  NMGR:dlr_kelf_load                           Failed to load mlaop
2024-May-23 13:47:16.0505  3065:3065  ERROR  NMGR:load_kelf_graphs                        Failed to load KELF kelf-b.json
2024-May-23 13:47:16.0505  3065:3065  ERROR  NMGR:kmgr_load_nn_post_metrics               Failed to load NN: 1.22.0.0+d4b4f5311-/tmp/tmp87ql08z_, err: 2
Traceback (most recent call last):
  File "/home/ubuntu/src/models/building_model/trace_rtdetr.py", line 73, in <module>
    rtdetr = torch.jit.load(neuron_model_path)
  File "/home/ubuntu/gstreamer-venv/lib/python3.10/site-packages/torch_neuron/jit_load_wrapper.py", line 13, in wrapper
    script_module = jit_load(*args, **kwargs)
  File "/home/ubuntu/gstreamer-venv/lib/python3.10/site-packages/torch/jit/_serialization.py", line 162, in load
    cpp_module = torch._C.import_ir_module(cu, str(f), map_location, _extra_files)
RuntimeError: Could not load the model status=2 message=Invalid

DEBUG logs of the final job:

05/23/2024 12:52:46 PM INFO [WalrusDriver.0]: ru_maxrss:  1878mb (delta=0mb)
05/23/2024 12:52:46 PM INFO [WalrusDriver.0]: Walrus pass: anti_dependency_analyzer succeeded!
05/23/2024 12:52:46 PM INFO [WalrusDriver.0]: Output has 4 module(s), 4 function(s), 88469 memory location(s), 4 block(s), and 79864 instruction(s).
05/23/2024 12:52:46 PM INFO [WalrusDriver.0]: Running walrus pass: post_sched
05/23/2024 12:52:46 PM INFO [WalrusDriver.0]: Input to post_sched: modules=4 functions=4 allocs=88469 blocks=4 instructions=79864
05/23/2024 12:52:46 PM INFO [TheScheduler.0]: Start PosT ScheD 2 inferentia Thu May 23 12:52:46 2024
05/23/2024 12:52:46 PM WARNING [TheScheduler.0]: Warning 2: scheduling level for block downgraded to 1.
05/23/2024 12:52:46 PM DEBUG [TheScheduler.0]: Start edge optimization Thu May 23 12:52:46 2024
05/23/2024 12:52:46 PM DEBUG [TheScheduler.0]: Before: BIR lifetimeInfo (following WavegraphIR's lifetime metrics calculation) : max:12411 min:1 mean:6564.06 std:3351.51 sum:91450472 count:13932 avgPred:2.79213
05/23/2024 12:52:46 PM DEBUG [TheScheduler.0]: After: BIR lifetimeInfo (following WavegraphIR's lifetime metrics calculation) : max:158 min:1 mean:37.3644 std:45.9019 sum:520561 count:13932 avgPred:1.03108
05/23/2024 12:52:46 PM DEBUG [TheScheduler.0]: After: BIR lifetimeInfo (estimating Stargazer's InFlight event count) : max:5 min:0 mean:0.0405541 std:0.301141 sum:565 count:13932 avgPred:0.0101924
05/23/2024 12:52:46 PM DEBUG [TheScheduler.0]: Finish edge optimization Thu May 23 12:52:46 2024
05/23/2024 12:52:46 PM INFO [TheScheduler.0]: Done  PosT ScheD Thu May 23 12:52:46 2024
05/23/2024 12:52:46 PM INFO [TheScheduler.0]: Start PosT ScheD 2 inferentia Thu May 23 12:52:46 2024
05/23/2024 12:52:48 PM DEBUG [TheScheduler.0]: Start edge optimization Thu May 23 12:52:48 2024
05/23/2024 12:52:48 PM DEBUG [TheScheduler.0]: Before: BIR lifetimeInfo (following WavegraphIR's lifetime metrics calculation) : max:17217 min:0 mean:7525.95 std:6946.89 sum:299171424 count:25820 avgPred:2.1402
05/23/2024 12:52:48 PM DEBUG [TheScheduler.0]: After: BIR lifetimeInfo (following WavegraphIR's lifetime metrics calculation) : max:6855 min:0 mean:1952.23 std:2034.91 sum:77605081 count:25820 avgPred:1.60612
05/23/2024 12:52:48 PM DEBUG [TheScheduler.0]: After: BIR lifetimeInfo (estimating Stargazer's InFlight event count) : max:5 min:0 mean:1.23262 std:1.76479 sum:48999 count:25820 avgPred:0.357514
05/23/2024 12:52:48 PM DEBUG [TheScheduler.0]: Finish edge optimization Thu May 23 12:52:48 2024
05/23/2024 12:52:49 PM INFO [TheScheduler.0]: Done  PosT ScheD Thu May 23 12:52:49 2024
05/23/2024 12:52:49 PM INFO [TheScheduler.0]: Start PosT ScheD 2 inferentia Thu May 23 12:52:49 2024
05/23/2024 12:52:50 PM DEBUG [TheScheduler.0]: Start edge optimization Thu May 23 12:52:50 2024
05/23/2024 12:52:50 PM DEBUG [TheScheduler.0]: Before: BIR lifetimeInfo (following WavegraphIR's lifetime metrics calculation) : max:12844 min:0 mean:3062.19 std:4633.21 sum:192624222 count:23152 avgPred:2.8258
05/23/2024 12:52:50 PM DEBUG [TheScheduler.0]: After: BIR lifetimeInfo (following WavegraphIR's lifetime metrics calculation) : max:2304 min:0 mean:203.778 std:571.744 sum:12818463 count:23152 avgPred:1.24076
05/23/2024 12:52:50 PM DEBUG [TheScheduler.0]: After: BIR lifetimeInfo (estimating Stargazer's InFlight event count) : max:5 min:0 mean:0.479349 std:1.12028 sum:30153 count:23152 avgPred:0.276909
05/23/2024 12:52:50 PM DEBUG [TheScheduler.0]: Finish edge optimization Thu May 23 12:52:50 2024
05/23/2024 12:52:50 PM INFO [TheScheduler.0]: Done  PosT ScheD Thu May 23 12:52:50 2024
05/23/2024 12:52:50 PM INFO [TheScheduler.0]: Start PosT ScheD 2 inferentia Thu May 23 12:52:50 2024
05/23/2024 12:52:51 PM DEBUG [TheScheduler.0]: Start edge optimization Thu May 23 12:52:51 2024
05/23/2024 12:52:51 PM DEBUG [TheScheduler.0]: Before: BIR lifetimeInfo (following WavegraphIR's lifetime metrics calculation) : max:16320 min:0 mean:2354.87 std:4913.48 sum:188069279 count:16960 avgPred:4.20312
05/23/2024 12:52:51 PM DEBUG [TheScheduler.0]: After: BIR lifetimeInfo (following WavegraphIR's lifetime metrics calculation) : max:64 min:0 mean:5.39723 std:12.3601 sum:431044 count:16960 avgPred:1.02842
05/23/2024 12:52:51 PM DEBUG [TheScheduler.0]: After: BIR lifetimeInfo (estimating Stargazer's InFlight event count) : max:6 min:0 mean:0.354315 std:1.05361 sum:28297 count:16960 avgPred:0.291745
05/23/2024 12:52:51 PM DEBUG [TheScheduler.0]: Finish edge optimization Thu May 23 12:52:51 2024
05/23/2024 12:52:51 PM INFO [TheScheduler.0]: Done  PosT ScheD Thu May 23 12:52:51 2024
05/23/2024 12:52:51 PM INFO [WalrusDriver.0]: ru_maxrss:  1878mb (delta=0mb)
05/23/2024 12:52:51 PM INFO [WalrusDriver.0]: Walrus pass: post_sched succeeded!
05/23/2024 12:52:51 PM INFO [WalrusDriver.0]: Output has 4 module(s), 4 function(s), 88469 memory location(s), 4 block(s), and 79864 instruction(s).
05/23/2024 12:52:51 PM INFO [WalrusDriver.0]: Running walrus pass: tensorcopy_accel
05/23/2024 12:52:51 PM INFO [WalrusDriver.0]: Input to tensorcopy_accel: modules=4 functions=4 allocs=88469 blocks=4 instructions=79864
05/23/2024 12:52:51 PM INFO [WalrusDriver.0]: Running peephole optimization pass
05/23/2024 12:52:51 PM DEBUG [WalrusDriver.0]: Accelerated 0 out of 6840 tensorcopy in Function: sg00 average acceleration factor: -nan
05/23/2024 12:52:51 PM INFO [WalrusDriver.0]: Running peephole optimization pass
05/23/2024 12:52:51 PM DEBUG [WalrusDriver.0]: Accelerated 0 out of 6266 tensorcopy in Function: sg01 average acceleration factor: -nan
05/23/2024 12:52:51 PM INFO [WalrusDriver.0]: Running peephole optimization pass
05/23/2024 12:52:51 PM DEBUG [WalrusDriver.0]: Accelerated 0 out of 4816 tensorcopy in Function: sg02 average acceleration factor: -nan
05/23/2024 12:52:51 PM INFO [WalrusDriver.0]: Running peephole optimization pass
05/23/2024 12:52:51 PM DEBUG [WalrusDriver.0]: Accelerated 0 out of 5543 tensorcopy in Function: sg03 average acceleration factor: -nan
05/23/2024 12:52:51 PM INFO [WalrusDriver.0]: ru_maxrss:  1878mb (delta=0mb)
05/23/2024 12:52:51 PM INFO [WalrusDriver.0]: Walrus pass: tensorcopy_accel succeeded!
05/23/2024 12:52:51 PM INFO [WalrusDriver.0]: Output has 4 module(s), 4 function(s), 88469 memory location(s), 4 block(s), and 79864 instruction(s).
05/23/2024 12:52:51 PM INFO [WalrusDriver.0]: Running walrus pass: birverifier
05/23/2024 12:52:51 PM INFO [WalrusDriver.0]: Input to birverifier: modules=4 functions=4 allocs=88469 blocks=4 instructions=79864
05/23/2024 12:52:52 PM INFO [WalrusDriver.0]: ru_maxrss:  1878mb (delta=0mb)
05/23/2024 12:52:52 PM INFO [WalrusDriver.0]: Walrus pass: birverifier succeeded!
05/23/2024 12:52:52 PM INFO [WalrusDriver.0]: Output has 4 module(s), 4 function(s), 88469 memory location(s), 4 block(s), and 79864 instruction(s).
05/23/2024 12:52:52 PM INFO [WalrusDriver.0]: Running walrus pass: run_stargazer
05/23/2024 12:52:52 PM INFO [WalrusDriver.0]: Input to run_stargazer: modules=4 functions=4 allocs=88469 blocks=4 instructions=79864
05/23/2024 12:52:52 PM INFO [Stargazer.0]: Stargazer starts [in memory BIR module]
05/23/2024 12:52:52 PM INFO [Stargazer.0]: Current working directory: "/tmp/tmpr5qfiuhx/sg00/sg00"
05/23/2024 12:52:52 PM INFO [Stargazer.0]: Generating Arch 'Inferentia-1.0'
05/23/2024 12:52:52 PM INFO [Stargazer.0]: INFO: Pre SG DRAM bytes loaded or saved 6325376
05/23/2024 12:52:52 PM INFO [Stargazer.0]: INFO: Pre SG average DMA size 32 bytes
05/23/2024 12:52:52 PM INFO [Stargazer.0]: Num Loads in Func = 54
05/23/2024 12:52:52 PM INFO [Stargazer.0]: Num Saves in Func = 6760
05/23/2024 12:52:52 PM INFO [Stargazer.0]: Num Input Loads in Func= 54
05/23/2024 12:52:52 PM INFO [Stargazer.0]: Num Output Saves in Func= 6760
05/23/2024 12:52:52 PM INFO [Stargazer.0]: Num Spill Loads in Func= 0
05/23/2024 12:52:52 PM INFO [Stargazer.0]: Num Spill Saves in Func= 0
05/23/2024 12:52:52 PM INFO [Stargazer.0]: Wavegraph code generation for Inferentia:
05/23/2024 12:52:52 PM INFO [Stargazer.0]:     Engine              File
05/23/2024 12:52:52 PM INFO [Stargazer.0]:     ------              ----
05/23/2024 12:52:52 PM INFO [Stargazer.0]:     PE-Array            pe.bin
05/23/2024 12:52:52 PM INFO [Stargazer.0]:     Pool-Eng            pool.bin
05/23/2024 12:52:52 PM INFO [Stargazer.0]:     Act-Eng             act.bin
05/23/2024 12:52:52 PM INFO [Stargazer.0]: 
05/23/2024 12:52:52 PM INFO [Stargazer.0]: Fixing data race is 0
05/23/2024 12:52:52 PM INFO [Stargazer.0]: Data race checker engines
05/23/2024 12:52:52 PM INFO [Stargazer.0]: [Sailfish] Data race analysis initially
05/23/2024 12:52:52 PM INFO [Stargazer.0]: [Sailfish] Data race analysis found no races, run time: 0:00:00
05/23/2024 12:52:52 PM INFO [Stargazer.0]: [Sailfish] Remove redundant edges
05/23/2024 12:52:52 PM INFO [Stargazer.0]: Data race checker engines
05/23/2024 12:52:52 PM INFO [Stargazer.0]: Transitive reduction start 
05/23/2024 12:52:52 PM INFO [Stargazer.0]: Transitive reduction removed 0 redundant edges, time: 0:00:00
05/23/2024 12:52:52 PM INFO [Stargazer.0]: Sync Critical Load Chains Start
05/23/2024 12:52:52 PM DEBUG [Stargazer.0]: SyncCritLoads buildLoadGraph Start...
05/23/2024 12:52:52 PM DEBUG [Stargazer.0]: SyncCritLoads buildLoadGraph Done.
05/23/2024 12:52:52 PM DEBUG [Stargazer.0]: Load Graph NumRoots; 4
05/23/2024 12:52:52 PM INFO [Stargazer.0]: Sync Critical Load Chains added 0 new Load-2-Load syncs
05/23/2024 12:52:52 PM INFO [Stargazer.0]: Sync Critical Load Chains Done.0:00:00
05/23/2024 12:52:53 PM INFO [Stargazer.0]: Out wavegraph bin file is wavegraph-bin.json
05/23/2024 12:52:53 PM INFO [Stargazer.0]: Writing NN JSON to file 'wavegraph-bin.json'
05/23/2024 12:52:54 PM INFO [Stargazer.0]: Virtual memory peak = 2969184 K bytes
05/23/2024 12:52:54 PM INFO [Stargazer.0]: PASSED - Total time: 0:00:02
05/23/2024 12:52:54 PM INFO [Stargazer.0]: Stargazer starts [in memory BIR module]
05/23/2024 12:52:54 PM INFO [Stargazer.0]: Current working directory: "/tmp/tmpr5qfiuhx/sg00/sg01"
05/23/2024 12:52:54 PM INFO [Stargazer.0]: Generating Arch 'Inferentia-1.0'
05/23/2024 12:52:54 PM INFO [Stargazer.0]: INFO: Pre SG DRAM bytes loaded or saved 4102016
05/23/2024 12:52:54 PM INFO [Stargazer.0]: INFO: Pre SG average DMA size 12 bytes
05/23/2024 12:52:54 PM INFO [Stargazer.0]: Num Loads in Func = 6776
05/23/2024 12:52:54 PM INFO [Stargazer.0]: Num Saves in Func = 7601
05/23/2024 12:52:54 PM INFO [Stargazer.0]: Num Input Loads in Func= 6762
05/23/2024 12:52:54 PM INFO [Stargazer.0]: Num Output Saves in Func= 7587
05/23/2024 12:52:54 PM INFO [Stargazer.0]: Num Spill Loads in Func= 14
05/23/2024 12:52:54 PM INFO [Stargazer.0]: Num Spill Saves in Func= 14
05/23/2024 12:52:55 PM INFO [Stargazer.0]: Wavegraph code generation for Inferentia:
05/23/2024 12:52:55 PM INFO [Stargazer.0]:     Engine              File
05/23/2024 12:52:55 PM INFO [Stargazer.0]:     ------              ----
05/23/2024 12:52:55 PM INFO [Stargazer.0]:     PE-Array            pe.bin
05/23/2024 12:52:55 PM INFO [Stargazer.0]:     Pool-Eng            pool.bin
05/23/2024 12:52:55 PM INFO [Stargazer.0]:     Act-Eng             act.bin
05/23/2024 12:52:55 PM INFO [Stargazer.0]: 
05/23/2024 12:52:55 PM INFO [Stargazer.0]: Fixing data race is 0
05/23/2024 12:52:55 PM INFO [Stargazer.0]: Data race checker engines
05/23/2024 12:52:55 PM INFO [Stargazer.0]: [Sailfish] Data race analysis initially
05/23/2024 12:52:58 PM INFO [Stargazer.0]: [Sailfish] Data race analysis found no races, run time: 0:00:03
05/23/2024 12:52:58 PM INFO [Stargazer.0]: [Sailfish] Remove redundant edges
05/23/2024 12:52:58 PM INFO [Stargazer.0]: Data race checker engines
05/23/2024 12:52:58 PM INFO [Stargazer.0]: Transitive reduction start 
05/23/2024 12:52:58 PM INFO [Stargazer.0]: Transitive reduction removed 3150 redundant edges, time: 0:00:00
05/23/2024 12:52:58 PM INFO [Stargazer.0]: Sync Critical Load Chains Start
05/23/2024 12:52:58 PM DEBUG [Stargazer.0]: SyncCritLoads buildLoadGraph Start...
05/23/2024 12:52:58 PM DEBUG [Stargazer.0]: SyncCritLoads buildLoadGraph Done.
05/23/2024 12:52:58 PM DEBUG [Stargazer.0]: Load Graph NumRoots; 1
05/23/2024 12:53:19 PM INFO [Stargazer.0]: Sync Critical Load Chains added 0 new Load-2-Load syncs
05/23/2024 12:53:19 PM INFO [Stargazer.0]: Sync Critical Load Chains Done.0:00:20
05/23/2024 12:53:21 PM INFO [Stargazer.0]: Out wavegraph bin file is wavegraph-bin.json
05/23/2024 12:53:21 PM INFO [Stargazer.0]: Writing NN JSON to file 'wavegraph-bin.json'
05/23/2024 12:53:22 PM INFO [Stargazer.0]: Virtual memory peak = 2969184 K bytes
05/23/2024 12:53:22 PM INFO [Stargazer.0]: PASSED - Total time: 0:00:28
05/23/2024 12:53:22 PM INFO [Stargazer.0]: Stargazer starts [in memory BIR module]
05/23/2024 12:53:22 PM INFO [Stargazer.0]: Current working directory: "/tmp/tmpr5qfiuhx/sg00/sg02"
05/23/2024 12:53:22 PM INFO [Stargazer.0]: Generating Arch 'Inferentia-1.0'
05/23/2024 12:53:23 PM INFO [Stargazer.0]: INFO: Pre SG DRAM bytes loaded or saved 3527296
05/23/2024 12:53:23 PM INFO [Stargazer.0]: INFO: Pre SG average DMA size 18 bytes
05/23/2024 12:53:23 PM INFO [Stargazer.0]: Num Loads in Func = 7661
05/23/2024 12:53:23 PM INFO [Stargazer.0]: Num Saves in Func = 4410
05/23/2024 12:53:23 PM INFO [Stargazer.0]: Num Input Loads in Func= 7589
05/23/2024 12:53:23 PM INFO [Stargazer.0]: Num Output Saves in Func= 4338
05/23/2024 12:53:23 PM INFO [Stargazer.0]: Num Spill Loads in Func= 72
05/23/2024 12:53:23 PM INFO [Stargazer.0]: Num Spill Saves in Func= 72
05/23/2024 12:53:23 PM INFO [Stargazer.0]: Wavegraph code generation for Inferentia:
05/23/2024 12:53:23 PM INFO [Stargazer.0]:     Engine              File
05/23/2024 12:53:23 PM INFO [Stargazer.0]:     ------              ----
05/23/2024 12:53:23 PM INFO [Stargazer.0]:     PE-Array            pe.bin
05/23/2024 12:53:23 PM INFO [Stargazer.0]:     Pool-Eng            pool.bin
05/23/2024 12:53:23 PM INFO [Stargazer.0]:     Act-Eng             act.bin
05/23/2024 12:53:23 PM INFO [Stargazer.0]: 
05/23/2024 12:53:23 PM INFO [Stargazer.0]: Fixing data race is 0
05/23/2024 12:53:23 PM INFO [Stargazer.0]: Data race checker engines
05/23/2024 12:53:23 PM INFO [Stargazer.0]: [Sailfish] Data race analysis initially
05/23/2024 12:53:24 PM INFO [Stargazer.0]: [Sailfish] Data race analysis found no races, run time: 0:00:00
05/23/2024 12:53:24 PM INFO [Stargazer.0]: [Sailfish] Remove redundant edges
05/23/2024 12:53:24 PM INFO [Stargazer.0]: Data race checker engines
05/23/2024 12:53:24 PM INFO [Stargazer.0]: Transitive reduction start 
05/23/2024 12:53:24 PM INFO [Stargazer.0]: Transitive reduction removed 123 redundant edges, time: 0:00:00
05/23/2024 12:53:24 PM INFO [Stargazer.0]: Sync Critical Load Chains Start
05/23/2024 12:53:24 PM DEBUG [Stargazer.0]: SyncCritLoads buildLoadGraph Start...
05/23/2024 12:53:24 PM DEBUG [Stargazer.0]: SyncCritLoads buildLoadGraph Done.
05/23/2024 12:53:24 PM DEBUG [Stargazer.0]: Load Graph NumRoots; 2
05/23/2024 12:53:38 PM INFO [Stargazer.0]: Sync Critical Load Chains added 23 new Load-2-Load syncs
05/23/2024 12:53:38 PM INFO [Stargazer.0]: Sync Critical Load Chains Done.0:00:13
05/23/2024 12:53:39 PM INFO [Stargazer.0]: Out wavegraph bin file is wavegraph-bin.json
05/23/2024 12:53:39 PM INFO [Stargazer.0]: Writing NN JSON to file 'wavegraph-bin.json'
05/23/2024 12:53:40 PM INFO [Stargazer.0]: Virtual memory peak = 2969184 K bytes
05/23/2024 12:53:40 PM INFO [Stargazer.0]: PASSED - Total time: 0:00:17
05/23/2024 12:53:40 PM INFO [Stargazer.0]: Stargazer starts [in memory BIR module]
05/23/2024 12:53:40 PM INFO [Stargazer.0]: Current working directory: "/tmp/tmpr5qfiuhx/sg00/sg03"
05/23/2024 12:53:40 PM INFO [Stargazer.0]: Generating Arch 'Inferentia-1.0'
05/23/2024 12:53:40 PM INFO [Stargazer.0]: INFO: Pre SG DRAM bytes loaded or saved 2772112
05/23/2024 12:53:40 PM INFO [Stargazer.0]: INFO: Pre SG average DMA size 40 bytes
05/23/2024 12:53:40 PM INFO [Stargazer.0]: Num Loads in Func = 4369
05/23/2024 12:53:40 PM INFO [Stargazer.0]: Num Saves in Func = 17
05/23/2024 12:53:40 PM INFO [Stargazer.0]: Num Input Loads in Func= 4357
05/23/2024 12:53:40 PM INFO [Stargazer.0]: Num Output Saves in Func= 5
05/23/2024 12:53:40 PM INFO [Stargazer.0]: Num Spill Loads in Func= 12
05/23/2024 12:53:40 PM INFO [Stargazer.0]: Num Spill Saves in Func= 12
05/23/2024 12:53:41 PM INFO [Stargazer.0]: Wavegraph code generation for Inferentia:
05/23/2024 12:53:41 PM INFO [Stargazer.0]:     Engine              File
05/23/2024 12:53:41 PM INFO [Stargazer.0]:     ------              ----
05/23/2024 12:53:41 PM INFO [Stargazer.0]:     PE-Array            pe.bin
05/23/2024 12:53:41 PM INFO [Stargazer.0]:     Pool-Eng            pool.bin
05/23/2024 12:53:41 PM INFO [Stargazer.0]:     Act-Eng             act.bin
05/23/2024 12:53:41 PM INFO [Stargazer.0]: 
05/23/2024 12:53:41 PM INFO [Stargazer.0]: Fixing data race is 0
05/23/2024 12:53:41 PM INFO [Stargazer.0]: Data race checker engines
05/23/2024 12:53:41 PM INFO [Stargazer.0]: [Sailfish] Data race analysis initially
05/23/2024 12:53:41 PM INFO [Stargazer.0]: [Sailfish] Data race analysis found no races, run time: 0:00:00
05/23/2024 12:53:41 PM INFO [Stargazer.0]: [Sailfish] Remove redundant edges
05/23/2024 12:53:41 PM INFO [Stargazer.0]: Data race checker engines
05/23/2024 12:53:41 PM INFO [Stargazer.0]: Transitive reduction start 
05/23/2024 12:53:41 PM INFO [Stargazer.0]: Transitive reduction removed 24 redundant edges, time: 0:00:00
05/23/2024 12:53:41 PM INFO [Stargazer.0]: Sync Critical Load Chains Start
05/23/2024 12:53:41 PM DEBUG [Stargazer.0]: SyncCritLoads buildLoadGraph Start...
05/23/2024 12:53:41 PM DEBUG [Stargazer.0]: SyncCritLoads buildLoadGraph Done.
05/23/2024 12:53:41 PM DEBUG [Stargazer.0]: Load Graph NumRoots; 6
05/23/2024 12:53:43 PM INFO [Stargazer.0]: Sync Critical Load Chains added 4 new Load-2-Load syncs
05/23/2024 12:53:43 PM INFO [Stargazer.0]: Sync Critical Load Chains Done.0:00:01
05/23/2024 12:53:43 PM INFO [Stargazer.0]: Out wavegraph bin file is wavegraph-bin.json
05/23/2024 12:53:43 PM INFO [Stargazer.0]: Writing NN JSON to file 'wavegraph-bin.json'
05/23/2024 12:53:44 PM INFO [Stargazer.0]: Virtual memory peak = 2969184 K bytes
05/23/2024 12:53:44 PM INFO [Stargazer.0]: PASSED - Total time: 0:00:03
05/23/2024 12:53:44 PM INFO [WalrusDriver.0]: ru_maxrss:  1878mb (delta=0mb)
05/23/2024 12:53:44 PM INFO [WalrusDriver.0]: Walrus pass: run_stargazer succeeded!
05/23/2024 12:53:44 PM INFO [WalrusDriver.0]: Output has 4 module(s), 4 function(s), 88469 memory location(s), 4 block(s), and 79864 instruction(s).
05/23/2024 12:54:07 PM DEBUG 2890 [job.WalrusDriver.3]: Walrus driver from bir.json to walrus_bir.out.json
05/23/2024 12:54:07 PM INFO 2890 [job.WalrusDriver.3]: IR signature: afdca5a3c064bfc0c6db028e9108175076aa65a68f2765b502e2e156b2fac84c for sg00/walrus_bir.out.json
05/23/2024 12:54:07 PM INFO 2890 [job.WalrusDriver.3]: IR signature: fa73716f8d05e8a0a7df3ed2c63cfe8975b9c00175592883ebc0d1d9d573acdb for sg01/walrus_bir.out.json
05/23/2024 12:54:07 PM INFO 2890 [job.WalrusDriver.3]: IR signature: fd82947d043bad92e0080654876e8d2879068771c826c22494a8f3c063608d6e for sg02/walrus_bir.out.json
05/23/2024 12:54:07 PM INFO 2890 [job.WalrusDriver.3]: IR signature: f581f522585380bc4110a8305aed565bf8a894e4c0fafb4ba50c25e924bf669b for sg03/walrus_bir.out.json
05/23/2024 12:54:07 PM INFO 2890 [job.WalrusDriver.3]: Job finished
05/23/2024 12:54:07 PM INFO 2890 [pipeline.compile.0]: Finished job job.WalrusDriver.3 with state 0
05/23/2024 12:54:07 PM INFO 2890 [pipeline.compile.0]: Starting job job.Backend.3 state state 0
05/23/2024 12:54:07 PM INFO 2890 [job.Backend.3]: Processing input #0
05/23/2024 12:54:07 PM INFO 2890 [job.Backend.3]: Replay this job by calling: /home/ubuntu/gstreamer-venv/bin/neuron-cc compile --framework TENSORFLOW --state '{"model": ["/tmp/tmpr5qfiuhx/graph_def.pb"], "tensormap": "tensor_map.json", "bir": "walrus_bir.out.json", "state_dir": "/tmp/tmpr5qfiuhx/sg00/sg00", "state_id": "sg00"}' --pipeline Backend --enable-experimental-bir-backend
05/23/2024 12:54:07 PM DEBUG 2890 [job.Backend.3]: actInfoFile is /home/ubuntu/gstreamer-venv/lib/python3.10/site-packages/neuroncc/pwp/pwp_bin_with_ln/act_info.json
05/23/2024 12:54:07 PM INFO 2890 [job.Backend.3]: IR signature: 89758cde0388d663bcc54f3bf4a899dc23454f01ecf8fae9f7e9ad876ed40ed8 for sg00/wavegraph-bin.json
05/23/2024 12:54:07 PM INFO 2890 [job.Backend.3]: IR signature: 9ec13868ffccb9edda1c3bc977c3f23f6b7885c63f409ce6343e5b27422da9e7 for sg00/def.json
05/23/2024 12:54:07 PM INFO 2890 [job.Backend.3]: IR signature: 5ead06b7d7042f96493f731be818e73408f6e3de3debecb2cb78b76fd997ef9f for sg00/pe.json
05/23/2024 12:54:07 PM INFO 2890 [job.Backend.3]: IR signature: 446ce5d20d2dbc06bd20227af6bce2e0bc1357321ed441f0223b4c469fb0d875 for sg00/pool.json
05/23/2024 12:54:07 PM INFO 2890 [job.Backend.3]: IR signature: 346beaddae596cf42c29cb1b04cb8472eb03dee9b412caceeef81c96fa9cdb31 for sg00/act.json
05/23/2024 12:54:07 PM INFO 2890 [job.Backend.3]: Job finished
05/23/2024 12:54:07 PM INFO 2890 [job.Backend.3]: Processing input #1
05/23/2024 12:54:07 PM INFO 2890 [job.Backend.3]: Replay this job by calling: /home/ubuntu/gstreamer-venv/bin/neuron-cc compile --framework TENSORFLOW --state '{"model": ["/tmp/tmpr5qfiuhx/graph_def.pb"], "tensormap": "tensor_map.json", "bir": "walrus_bir.out.json", "state_dir": "/tmp/tmpr5qfiuhx/sg00/sg01", "state_id": "sg01"}' --pipeline Backend --enable-experimental-bir-backend
05/23/2024 12:54:07 PM DEBUG 2890 [job.Backend.3]: actInfoFile is /home/ubuntu/gstreamer-venv/lib/python3.10/site-packages/neuroncc/pwp/pwp_bin_with_ln/act_info.json
05/23/2024 12:54:08 PM INFO 2890 [job.Backend.3]: IR signature: 2e929fae16bc555baf63ac7bae5f0c705f7dc037514e4e1403acddedc6980986 for sg01/wavegraph-bin.json
05/23/2024 12:54:08 PM INFO 2890 [job.Backend.3]: IR signature: d7c865d7504887446246481a553f162cae8910fbba064a8186a4e92225c6d8d7 for sg01/def.json
05/23/2024 12:54:08 PM INFO 2890 [job.Backend.3]: IR signature: 5ead06b7d7042f96493f731be818e73408f6e3de3debecb2cb78b76fd997ef9f for sg01/pe.json
05/23/2024 12:54:08 PM INFO 2890 [job.Backend.3]: IR signature: 2ba20523f3ead650f3712f33fad3c3e7b92d5f7fbac6ba0c9b366cfe740cd07b for sg01/pool.json
05/23/2024 12:54:08 PM INFO 2890 [job.Backend.3]: IR signature: c31126b76a65f91aba902e4daa3cebc9524160936a995076a7bea8f841599aa6 for sg01/act.json
05/23/2024 12:54:08 PM INFO 2890 [job.Backend.3]: Job finished
05/23/2024 12:54:08 PM INFO 2890 [job.Backend.3]: Processing input #2
05/23/2024 12:54:08 PM INFO 2890 [job.Backend.3]: Replay this job by calling: /home/ubuntu/gstreamer-venv/bin/neuron-cc compile --framework TENSORFLOW --state '{"model": ["/tmp/tmpr5qfiuhx/graph_def.pb"], "tensormap": "tensor_map.json", "bir": "walrus_bir.out.json", "state_dir": "/tmp/tmpr5qfiuhx/sg00/sg02", "state_id": "sg02"}' --pipeline Backend --enable-experimental-bir-backend
05/23/2024 12:54:08 PM DEBUG 2890 [job.Backend.3]: actInfoFile is /home/ubuntu/gstreamer-venv/lib/python3.10/site-packages/neuroncc/pwp/pwp_bin_with_ln/act_info.json
05/23/2024 12:54:08 PM INFO 2890 [job.Backend.3]: IR signature: bb9c382dc8e43da24f5e9945a6659c8a1659cc5d0800f4a78bb832306cf52eb6 for sg02/wavegraph-bin.json
05/23/2024 12:54:08 PM INFO 2890 [job.Backend.3]: IR signature: e94818576c02b7e5fe83214da706b3dddee48ba4b757b4e959c7e4143f0b50c7 for sg02/def.json
05/23/2024 12:54:08 PM INFO 2890 [job.Backend.3]: IR signature: 5ead06b7d7042f96493f731be818e73408f6e3de3debecb2cb78b76fd997ef9f for sg02/pe.json
05/23/2024 12:54:08 PM INFO 2890 [job.Backend.3]: IR signature: 7f5fbff5aa277f97a799af16aa3c562c91949d8491ca864fef5028f204e12b0b for sg02/pool.json
05/23/2024 12:54:08 PM INFO 2890 [job.Backend.3]: IR signature: c31126b76a65f91aba902e4daa3cebc9524160936a995076a7bea8f841599aa6 for sg02/act.json
05/23/2024 12:54:08 PM INFO 2890 [job.Backend.3]: Job finished
05/23/2024 12:54:08 PM INFO 2890 [job.Backend.3]: Processing input #3
05/23/2024 12:54:08 PM INFO 2890 [job.Backend.3]: Replay this job by calling: /home/ubuntu/gstreamer-venv/bin/neuron-cc compile --framework TENSORFLOW --state '{"model": ["/tmp/tmpr5qfiuhx/graph_def.pb"], "tensormap": "tensor_map.json", "bir": "walrus_bir.out.json", "state_dir": "/tmp/tmpr5qfiuhx/sg00/sg03", "state_id": "sg03"}' --pipeline Backend --enable-experimental-bir-backend
05/23/2024 12:54:08 PM DEBUG 2890 [job.Backend.3]: actInfoFile is /home/ubuntu/gstreamer-venv/lib/python3.10/site-packages/neuroncc/pwp/pwp_bin_with_ln/act_info.json
05/23/2024 12:54:08 PM INFO 2890 [job.Backend.3]: IR signature: 5210ffcaa3370d573a26e7afec9c7572ccf54d129e2649eb5755655272ece2eb for sg03/wavegraph-bin.json
05/23/2024 12:54:08 PM INFO 2890 [job.Backend.3]: IR signature: db4aaa028c13ab6df36af2c2faf07a1ef405a58d86dc66c87d429ac0ba9e76cc for sg03/def.json
05/23/2024 12:54:08 PM INFO 2890 [job.Backend.3]: IR signature: 5ead06b7d7042f96493f731be818e73408f6e3de3debecb2cb78b76fd997ef9f for sg03/pe.json
05/23/2024 12:54:08 PM INFO 2890 [job.Backend.3]: IR signature: 0bcae698358f19bfad6ec2ab9d24ee243ff9b28e1a86f493dc6d02ef4eda77dc for sg03/pool.json
05/23/2024 12:54:08 PM INFO 2890 [job.Backend.3]: IR signature: e2fe3aa59a4d58aef31dccf636e9a796bd978e25b49f7c6e89099b63748781ed for sg03/act.json
05/23/2024 12:54:08 PM INFO 2890 [job.Backend.3]: Job finished
05/23/2024 12:54:08 PM INFO 2890 [pipeline.compile.0]: Finished job job.Backend.3 with state 0
05/23/2024 12:54:08 PM INFO 2890 [pipeline.compile.0]: Starting job job.Kelper.2 state state 0
05/23/2024 12:54:08 PM INFO 2890 [job.Kelper.2]: Replay this job by calling: /home/ubuntu/gstreamer-venv/bin/neuron-cc compile --framework TENSORFLOW --state '{"model": ["/tmp/tmpr5qfiuhx/graph_def.pb"], "tensormap": "tensor_map.json", "bir": "walrus_bir.out.json", "wavegraph": "wavegraph-bin.json", "state_dir": "/tmp/tmpr5qfiuhx/sg00/sg00", "state_id": "sg00"}' '{"model": ["/tmp/tmpr5qfiuhx/graph_def.pb"], "tensormap": "tensor_map.json", "bir": "walrus_bir.out.json", "wavegraph": "wavegraph-bin.json", "state_dir": "/tmp/tmpr5qfiuhx/sg00/sg01", "state_id": "sg01"}' '{"model": ["/tmp/tmpr5qfiuhx/graph_def.pb"], "tensormap": "tensor_map.json", "bir": "walrus_bir.out.json", "wavegraph": "wavegraph-bin.json", "state_dir": "/tmp/tmpr5qfiuhx/sg00/sg02", "state_id": "sg02"}' '{"model": ["/tmp/tmpr5qfiuhx/graph_def.pb"], "tensormap": "tensor_map.json", "bir": "walrus_bir.out.json", "wavegraph": "wavegraph-bin.json", "state_dir": "/tmp/tmpr5qfiuhx/sg00/sg03", "state_id": "sg03"}' --pipeline Kelper
05/23/2024 12:54:08 PM DEBUG 2890 [job.Kelper.2]: Kelper using Experimental BIR-Partitioning Flow. Root Dir /tmp/tmpr5qfiuhx/sg00
05/23/2024 12:54:09 PM WARNING 2890 [job.Kelper.2]: writeKelp missing file sg00/nn_def.json
05/23/2024 12:54:10 PM WARNING 2890 [job.Kelper.2]: writeKelp missing file sg00/kelf.json
05/23/2024 12:54:12 PM WARNING 2890 [job.Kelper.2]: writeKelp missing file sg01/nn_def.json
05/23/2024 12:54:12 PM WARNING 2890 [job.Kelper.2]: writeKelp missing file sg01/kelf.json
05/23/2024 12:54:15 PM WARNING 2890 [job.Kelper.2]: writeKelp missing file sg02/nn_def.json
05/23/2024 12:54:15 PM WARNING 2890 [job.Kelper.2]: writeKelp missing file sg02/kelf.json
05/23/2024 12:54:16 PM WARNING 2890 [job.Kelper.2]: writeKelp missing file sg03/nn_def.json
05/23/2024 12:54:16 PM WARNING 2890 [job.Kelper.2]: writeKelp missing file sg03/kelf.json
05/23/2024 12:54:17 PM INFO 2890 [job.Kelper.2]: neuroncc version is 1.22.0.0+d4b4f5311, neff version is 1.0 (features 0)
05/23/2024 12:54:17 PM INFO 2890 [job.Kelper.2]: wrote /tmp/tmpr5qfiuhx/graph_def.neff
05/23/2024 12:54:17 PM INFO 2890 [pipeline.compile.0]: Finished job job.Kelper.2 with state 0
05/23/2024 12:54:17 PM INFO 2890 [pipeline.compile.0]: Finished pipeline compile
05/23/2024 12:54:17 PM INFO 2890 [pipeline.compile.0]: Job finished
05/23/2024 12:54:17 PM INFO 2890 [pipeline.custom.0]: Finished job pipeline.compile.0 with state 0
05/23/2024 12:54:17 PM INFO 2890 [pipeline.custom.0]: Starting job job.SaveTemps.0 state state 0
05/23/2024 12:54:17 PM INFO 2890 [pipeline.custom.0]: Finished job job.SaveTemps.0 with state 0
05/23/2024 12:54:17 PM INFO 2890 [pipeline.custom.0]: Finished pipeline custom
05/23/2024 12:54:17 PM INFO 2890 [pipeline.custom.0]: Job finished
05/23/2024 12:54:17 PM INFO 2890 [root]: Compiler status PASS
INFO:Neuron:Number of arithmetic operators (post-compilation) before = 885, compiled = 869, percent compiled = 98.19%
INFO:Neuron:The neuron partitioner created 10 sub-graphs
INFO:Neuron:Neuron successfully compiled 10 sub-graphs, Total fused subgraphs = 10, Percent of model sub-graphs successfully compiled = 100.0%
INFO:Neuron:Compiled these operators (and operator counts) to Neuron:
INFO:Neuron: => aten::Int: 147
INFO:Neuron: => aten::_convolution: 57
INFO:Neuron: => aten::add: 37
INFO:Neuron: => aten::avg_pool2d: 3
INFO:Neuron: => aten::batch_norm: 45
INFO:Neuron: => aten::bmm: 8
INFO:Neuron: => aten::chunk: 8
INFO:Neuron: => aten::clip: 9
INFO:Neuron: => aten::contiguous: 17
INFO:Neuron: => aten::detach: 2
INFO:Neuron: => aten::div: 14
INFO:Neuron: => aten::dropout: 15
INFO:Neuron: => aten::flatten: 25
INFO:Neuron: => aten::gelu: 1
INFO:Neuron: => aten::layer_norm: 12
INFO:Neuron: => aten::linear: 57
INFO:Neuron: => aten::log: 3
INFO:Neuron: => aten::max: 1
INFO:Neuron: => aten::max_pool2d: 1
INFO:Neuron: => aten::mul: 56
INFO:Neuron: => aten::permute: 29
INFO:Neuron: => aten::relu: 3
INFO:Neuron: => aten::relu_: 30
INFO:Neuron: => aten::repeat: 2
INFO:Neuron: => aten::reshape: 28
INFO:Neuron: => aten::rsub: 3
INFO:Neuron: => aten::select: 11
INFO:Neuron: => aten::sigmoid: 4
INFO:Neuron: => aten::silu_: 28
INFO:Neuron: => aten::size: 61
INFO:Neuron: => aten::slice: 51
INFO:Neuron: => aten::softmax: 7
INFO:Neuron: => aten::split_with_sizes: 3
INFO:Neuron: => aten::stack: 5
INFO:Neuron: => aten::sub: 3
INFO:Neuron: => aten::sum: 3
INFO:Neuron: => aten::to: 4
INFO:Neuron: => aten::topk: 1
INFO:Neuron: => aten::transpose: 36
INFO:Neuron: => aten::unsqueeze: 17
INFO:Neuron: => aten::upsample_nearest2d: 2
INFO:Neuron: => aten::view: 20
INFO:Neuron:Not compiled operators (and operator counts) to Neuron:
INFO:Neuron: => aten::concat: 5 [not supported]
INFO:Neuron: => aten::gather: 2 [not supported]
INFO:Neuron: => aten::grid_sampler: 9 [not supported]

Instance:

instance_type = "inf1.xlarge"
ami = "ami-09627c82937ccdd6d"
region="eu-west-2"

ENV:

> neuron-cc --version
Neuron Compiler version 1.22.0.0+d4b4f5311

HWM version 1.17.0.0-fbcd6c853
NEFF version Dynamic
TVM version 1.19.0.0+0
NumPy version 1.22.2
MXNet not available
TF not available

> python --version
Python 3.10.12

> pip list
Package                  Version
------------------------ ------------------
absl-py                  2.1.0
annotated-types          0.6.0
anyio                    4.2.0
astor                    0.8.1
attrs                    23.2.0
certifi                  2024.2.2
charset-normalizer       3.3.2
click                    8.1.7
decorator                5.1.1
dmlc-nnvm                1.19.0.0+0
dmlc-topi                1.19.0.0+0
dmlc-tvm                 1.19.0.0+0
exceptiongroup           1.2.0
fastapi                  0.109.0
gast                     0.2.2
gobject                  0.1.0
google-pasta             0.2.0
grpcio                   1.64.0
h11                      0.14.0
h5py                     3.6.0
httptools                0.6.1
idna                     3.6
inferentia-hwm           1.17.0.0+fbcd6c853
islpy                    2023.1
Jinja2                   3.1.3
Keras-Applications       1.0.8
Keras-Preprocessing      1.1.2
Markdown                 3.6
MarkupSafe               2.1.5
networkx                 2.6.3
neuron-cc                1.22.0.0+d4b4f5311
numpy                    1.22.2
nvidia-cublas-cu11       11.10.3.66
nvidia-cuda-nvrtc-cu11   11.7.99
nvidia-cuda-runtime-cu11 11.7.99
nvidia-cudnn-cu11        8.5.0.96
opt-einsum               3.3.0
pillow                   10.3.0
pip                      22.0.2
protobuf                 3.20.1
pycairo                  1.25.1
pydantic                 2.5.3
pydantic_core            2.14.6
PyGObject                3.46.0
python-dotenv            1.0.0
PyYAML                   6.0.1
requests                 2.32.2
scipy                    1.11.4
setuptools               70.0.0
six                      1.16.0
sniffio                  1.3.0
starlette                0.35.1
tensorboard              1.15.0
tensorflow               1.15.5.post1
tensorflow-estimator     1.15.1
termcolor                2.4.0
torch                    1.13.1
torch-neuron             1.13.1.2.9.74.0
torchvision              0.14.1
typing_extensions        4.9.0
urllib3                  2.2.1
uvicorn                  0.25.0
uvloop                   0.19.0
watchfiles               0.21.0
websockets               12.0
Werkzeug                 3.0.3
wheel                    0.43.0
wrapt                    1.16.0

Model:

RTDETR - https://github.com/lyuwenyu/RT-DETR

Steps to reproduce:

  1. pull: https://github.com/lyuwenyu/RT-DETR
  2. Run below (you'll get import errors):
    
    import os
    import sys
    import torch
    import time
    import torch.nn as nn
    import torch_neuron

from src.core import YAMLConfig from src.solver import TASKS from src.core.yaml_utils import load_config

config_name = 'rtdetr_r18vd_6x_coco.yml' config_path = os.path.join('configs', 'rtdetr', config_name)

cfg = YAMLConfig( config_path )

rtdetr = cfg.model rtdetr.deploy()

img = torch.rand(1, 3, 640, 640)

with torch.no_grad(): output = rtdetr(img)

neuron_model_path = 'rtdetr480_neuron_test.pt' model_neuron = torch.neuron.trace(rtdetr, img, compiler_args = ['--neuroncore-pipeline-cores', '4', '--verbose', 'DEBUG']) model_neuron.save(neuron_model_path)

os.environ['NEURON_RT_LOG_LEVEL'] = 'WARN' rtdetr = torch.jit.load(neuron_model_path) img = torch.rand(1, 3, 480, 480)

Warm-up

output = rtdetr(img)


3. Solve import errors by commenting out all the imported modules that raise errors. The model is being initiated together with all of the training elements which are not necessary for inference and can be commented out. 
aws-taylor commented 1 month ago

Thanks @Bartosz-G, we're taking a look. This may be the same issue as https://github.com/aws-neuron/aws-neuron-sdk/issues/891