Skip to content

Add cancel() and isBusy to InferenceEngine protocol#32

Merged
stikves merged 4 commits into
apple:mainfrom
stikves:sukru/engine-cancel-api
Jun 15, 2026
Merged

Add cancel() and isBusy to InferenceEngine protocol#32
stikves merged 4 commits into
apple:mainfrom
stikves:sukru/engine-cancel-api

Conversation

@stikves

@stikves stikves commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Adds lifecycle management APIs to the InferenceEngine protocol so callers can gracefully cancel in-flight generation and query busy state.

All three engine implementations (Sequential, Pipelined, StaticShape) and MockEngine are updated with concrete implementations.

CoreAILanguageModel now calls cancel() before reset() to ensure clean state transitions.

@stikves stikves force-pushed the sukru/engine-cancel-api branch from 4e5d422 to f1a8bf3 Compare June 12, 2026 20:11
@stikves stikves self-assigned this Jun 12, 2026
Comment thread swift/Sources/CoreAILanguageModels/InferenceEngines/CoreAIPipelinedEngine.swift Outdated
Comment thread swift/Sources/CoreAILanguageModels/InferenceEngines/CoreAISequentialEngine.swift Outdated
@stikves stikves force-pushed the sukru/engine-cancel-api branch from 1fd5faa to 50386a3 Compare June 12, 2026 21:23
Comment thread swift/Sources/CoreAILanguageModels/InferenceEngines/CoreAISequentialEngine.swift Outdated
@stikves stikves force-pushed the sukru/engine-cancel-api branch 3 times, most recently from 342fd81 to f666779 Compare June 12, 2026 22:40
@stikves stikves force-pushed the sukru/engine-cancel-api branch from f666779 to 1a754e1 Compare June 12, 2026 22:50
@stikves stikves merged commit e53b8b3 into apple:main Jun 15, 2026
3 checks passed
@stikves stikves deleted the sukru/engine-cancel-api branch June 15, 2026 17:58
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.

4 participants