Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[V2 Pipeline] SImple Asyncio pipeline test #1478

Open
wants to merge 16 commits into
base: main
Choose a base branch
from
Open

Conversation

horheynm
Copy link
Member

@horheynm horheynm commented Dec 14, 2023

Description

Adds tests for Pipeline.run_async()

Problem

Testing run_async() currently requires some hacking in tests/server. Isolate Pipeline func's test.

Solution

Simple pipeline running run_async

Usage

    inference_state = InferenceState()
    inference_state.create_state({})
    pipeline_input = IntSchema(value=5)

    pipeline_output = await AddThreePipeline.run_async(
        pipeline_input, inference_state=inference_state
    )

Note

using asyncio-pytest works fine locally, but when Pipelines are registered during pytest collection, it has conflicts
Ex.

INTERNALERROR> RuntimeError: Attempting to register name image_classification as <class 'src.deepsparse.image_classification.pipeline.ImageClassificationPipeline'> however image_classification has already been registered as <class 'deepsparse.image_classification.pipeline.ImageClassificationPipeline'>

So created homemade solution to run asyncio

bfineran
bfineran previously approved these changes Dec 14, 2023
setup.py Outdated Show resolved Hide resolved
@bfineran bfineran requested a review from dsikka January 8, 2024 16:02
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.

2 participants