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

Issue - 42 WhisperKit support simulator fixed #52

Merged
merged 6 commits into from
Mar 8, 2024

Conversation

bharat9806
Copy link
Contributor

#42

@@ -129,7 +129,7 @@ public struct ModelComputeOptions {
public var prefillCompute: MLComputeUnits

public init(
melCompute: MLComputeUnits = .cpuAndGPU,
melCompute: MLComputeUnits = .cpuOnly,
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

at least, we should use compiler macro and then use CPU only for simulator.

Copy link
Contributor

@ZachNagengast ZachNagengast left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep like @muukii mentioned, we'll want this to be default only for the simulator - see comment suggestion

Here's another example of how it should work https://github.com/huggingface/swift-transformers/pull/46/files

Comment on lines 132 to 135
melCompute: MLComputeUnits = .cpuOnly,
audioEncoderCompute: MLComputeUnits = .cpuAndNeuralEngine,
textDecoderCompute: MLComputeUnits = .cpuAndNeuralEngine,
prefillCompute: MLComputeUnits = .cpuOnly
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
melCompute: MLComputeUnits = .cpuOnly,
audioEncoderCompute: MLComputeUnits = .cpuAndNeuralEngine,
textDecoderCompute: MLComputeUnits = .cpuAndNeuralEngine,
prefillCompute: MLComputeUnits = .cpuOnly
#if targetEnvironment(simulator)
melCompute: MLComputeUnits = .cpuOnly,
audioEncoderCompute: MLComputeUnits = .cpuOnly,
textDecoderCompute: MLComputeUnits = .cpuOnly,
prefillCompute: MLComputeUnits = .cpuOnly
#else
melCompute: MLComputeUnits = .cpuAndGpu,
audioEncoderCompute: MLComputeUnits = .cpuAndNeuralEngine,
textDecoderCompute: MLComputeUnits = .cpuAndNeuralEngine,
prefillCompute: MLComputeUnits = .cpuOnly
#endif

@ZachNagengast ZachNagengast added the enhancement Improves existing code label Mar 6, 2024
@ZachNagengast
Copy link
Contributor

@bharat9806 based on this issue #65 I'd also like to push a fix to this branch and bundle them together, the tests are currently failing - will want to merge with main as well

@ZachNagengast ZachNagengast self-requested a review March 8, 2024 23:58
@ZachNagengast ZachNagengast merged commit bfa357e into argmaxinc:main Mar 8, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improves existing code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants