Skip to content

titvm: Add TVM inference plugin (titvm) for AM62D - #382

Closed
PrathamTI wants to merge 2 commits into
TexasInstruments:mainfrom
PrathamTI:horizon-dev
Closed

titvm: Add TVM inference plugin (titvm) for AM62D#382
PrathamTI wants to merge 2 commits into
TexasInstruments:mainfrom
PrathamTI:horizon-dev

Conversation

@PrathamTI

Copy link
Copy Markdown
Collaborator

Implement TVM-based inference element with TI C7x DSP acceleration using the TVM runtime with TIDL backend for TI AM62D platform.

Current Implementation:

Binary tensor inference support

  • Accepts raw float32 tensor input (application/octet-stream)
  • Produces float32 tensor output (application/octet-stream)
  • Direct TVM C++ runtime API integration

Performance benchmarking

  • Configurable inference iterations (iterations property)
  • Min/avg/max/fps statistics (benchmark property)
  • First inference includes model loading overhead
  • Subsequent inferences show true runtime performance

Model loading

  • Loads TVM artifacts: deploy_lib.so, deploy_graph.json, deploy_param.params
  • Artifacts must be compiled for AM62D C7x DSP with TVM TIDL backend
  • model-path property specifies artifacts directory

Properties:

  • model-path: Path to TVM artifacts directory (required)
  • iterations: Number of inference runs (default: 1)
  • benchmark: Enable performance statistics (default: true)

Pipeline Example:
gst-launch-1.0 filesrc location=input_tensor.bin blocksize=1048576 ! \ titvm model-path=/usr/share/tvm/artifacts iterations=1 ! \ filesink location=output_tensor.bin

TODO:

Audio enhancement pipeline integration

  • Add audio-mode property for complex spectral data processing
  • Implement deinterleave/interleave operations via C7x RPMsg
  • Integrate with STFT/ISTFT preprocessing/postprocessing elements
  • Add fft-size and input-shape properties for audio models

@PrathamTI
PrathamTI marked this pull request as draft August 19, 2026 15:09
@PrathamTI
PrathamTI force-pushed the horizon-dev branch 3 times, most recently from 9810a01 to 3bd9371 Compare August 20, 2026 08:30
Implement TVM-based machine learning inference element with TI C7x DSP acceleration
using the official TVM runtime with TIDL backend for TI AM62D platform.

This implementation uses the Neo-AI TVM runtime[0] with TIDL delegate for hardware-
accelerated inference on the C7x DSP.

Current Implementation:

Binary tensor inference support
  - Accepts raw float32 tensor input (application/octet-stream)
  - Produces float32 tensor output (application/octet-stream)
  - Direct TVM C++ runtime API integration

Performance benchmarking
  - Configurable inference iterations (iterations property)
  - Min/avg/max/fps statistics (benchmark property)
  - First inference includes model loading overhead
  - Subsequent inferences show true runtime performance

Model loading
  - Loads TVM artifacts: deploy_lib.so, deploy_graph.json, deploy_param.params
  - Artifacts must be compiled for AM62D C7x DSP with TVM TIDL backend
  - model-path property specifies artifacts directory

Properties:
  - model-path:  Path to TVM artifacts directory (required)
  - iterations:  Number of inference runs (default: 1)
  - benchmark:   Enable performance statistics (default: true)

Pipeline Example:
    gst-launch-1.0 filesrc location=input_tensor.bin blocksize=1048576 ! \
      titvm model-path=/usr/share/tvm/artifacts iterations=1 ! \
      filesink location=output_tensor.bin

TODO:

Audio enhancement pipeline integration
  - Add audio-mode property for complex spectral data processing
  - Implement deinterleave/interleave operations via C7x RPMsg
  - Integrate with STFT/ISTFT preprocessing/postprocessing elements
  - Add fft-size and input-shape properties for audio models

Signed-off-by: Pratham Deshmukh <p-deshmukh@ti.com>
Implement tidspkernel element using rpmsg_chan architecture from
dsptransform example. Single element handles STFT, ISTFT, deinterleave,
and interleave operations based on msg-type property.

- Add gsttirpmsgctx: Multi-endpoint RPMsg channel manager with mutex
- Add gstdspkernel: Generic DSP kernel transform element
- Remove separate tistft/tiistft elements (replaced by tidspkernel)
- Update titvm to work with float32 spectral data from tidspkernel
- Add stft-plugins build option

Signed-off-by: Pratham Deshmukh <p-deshmukh@ti.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant