Optimize model to remove two DFT nodes and some reshapes

#2
by justinchuby - opened
ONNX Community org
ONNX Model Information:
Inputs:
  - Name: INPUT, Shape: ['unk__1797', 144000], Type: tensor(float)
Outputs:
  - Name: Identity_0, Shape: ['unk__1798', 6522], Type: tensor(float)

TFLite Model Information:
Inputs:
  - Name: INPUT, Shape: [     1 144000], Type: <class 'numpy.float32'>
Outputs:
  - Name: Identity, Shape: [   1 6522], Type: <class 'numpy.float32'>

Generating random inputs:
  - INPUT: shape=(1, 144000), dtype=float32

Running ONNX model inference...
Running TFLite model inference...

================================================================================
COMPARISON RESULTS
================================================================================

Output 0:
  ONNX Runtime shape: (1, 6522), dtype: float32
  TFLite shape:       (1, 6522), dtype: float32

  ONNX Runtime vs TFLite:
    Max difference:  0.0000267029
    Mean difference: 0.0000058674
    Relative tolerance: 1e-05
    Absolute tolerance: 1e-05
    βœ… Outputs match within tolerance

================================================================================
βœ… ALL OUTPUTS MATCH!
================================================================================

Benchmarking ONNX model (10 warmup + 100 test runs)...
Benchmarking TFLite model (10 warmup + 100 test runs)...

================================================================================
BENCHMARK RESULTS
================================================================================

ONNX Model:
  Mean:   43.129 ms
  Median: 42.937 ms
  Std:    0.544 ms
  Min:    42.518 ms
  Max:    44.864 ms

TFLite Model:
  Mean:   26.878 ms
  Median: 26.283 ms
  Std:    1.665 ms
  Min:    26.152 ms
  Max:    37.190 ms

Comparison:
  TFLite is 1.60x faster than ONNX Runtime
  Difference: 16.251 ms
================================================================================
justinchuby changed pull request status to merged

Sign up or log in to comment