microsoft / microsoft/onnxruntime

Why it is not possible to `pickle` an `InferenceSession` object?

Open
#10,097 3 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

feature request
Dominant language
C++
Stars
21.9k
Forks
4.2k
Avg merge
4d 8h
Merged PRs (30d)
179

Description

Why it is not possible to pickle an InferenceSession object?
As I understand, this is because it's a CPP binding. Why it is a challenge? What will make it possible?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by investigating the Python binding for InferenceSession and how its C++-backed state interacts with Python pickle. Determine what serialization behavior would be required for an InferenceSession to be pickleable and document the constraints or implementation scope needed to consider the issue done.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, python
Domain
machine-learning
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.