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

Getting Buffer Validation newBufferWith must not exceed 256 MB error when I am trying to load model of 2.5 gb size #5384

Open
Pratik-7i opened this issue May 7, 2024 · 5 comments
Assignees
Labels
platform:ios MediaPipe IOS issues stat:awaiting googler Waiting for Google Engineer's Response task:LLM inference Issues related to MediaPipe LLM Inference Gen AI setup type:others issues not falling in bug, perfromance, support, build and install or feature

Comments

@Pratik-7i
Copy link

Pratik-7i commented May 7, 2024

I have downloaded Google iOS sample of MediaPipe and tried to load my model which is 2.5 GB in size.

private var inference: LlmInference! = {
    // slm1.bin is my model
    let path = Bundle.main.path(forResource: "slm1", ofType: "bin")!
    let llmOptions = LlmInference.Options(modelPath: path)
    return LlmInference(options: llmOptions)
}()

The project is built successfully but on App launch, I am getting following error:

-[MTLDebugDevice newBufferWithBytes:length:options:]:670: failed assertion `Buffer Validation
newBufferWith*:length 0x1f400000 must not exceed 256 MB.

I came to know that a single MTLBuffer is limited to a maximum length of 256MB. If we need a total allocation of more than 256 MB, we can allocate multiple buffers and split data among them, but I don't know how I will be able to do in case of this SDK.

@Pratik-7i Pratik-7i added the type:others issues not falling in bug, perfromance, support, build and install or feature label May 7, 2024
@kuaashish kuaashish assigned kuaashish and unassigned ayushgdev May 8, 2024
@kuaashish kuaashish added task:LLM inference Issues related to MediaPipe LLM Inference Gen AI setup platform:ios MediaPipe IOS issues labels May 8, 2024
@kuaashish
Copy link
Collaborator

Hi @Pratik-7i,

This is already on our roadmap, and while we have not yet tested it with iOS interface and other large models, we are actively working to ensure compatibility with them. This functionality will be available soon. Regarding the scenario you are currently using, please allow us some time to determine if we can assist with it.

Thank you!!

@kuaashish kuaashish added the stat:awaiting response Waiting for user response label May 8, 2024
@kuaashish
Copy link
Collaborator

Hi @priankakariatyml,

Do you know way to allocating multiple buffers and distributing data among them in the SDK? Any recommendations would be greatly valued.

Thank you!!

@google-ml-butler google-ml-butler bot removed the stat:awaiting response Waiting for user response label May 8, 2024
@kuaashish kuaashish added the stat:awaiting googler Waiting for Google Engineer's Response label May 8, 2024
@Pratik-7i
Copy link
Author

Thanks @kuaashish
Actually we need to integrate large model in our live project, can we know when this functionality might be available?

@kuaashish
Copy link
Collaborator

Hi @Pratik-7i,

We are unable to provide an exact date at this time. However, rest assured that it will be available soon. We will keep you informed of any updates through the same thread.

Thank you!!

@Pratik-7i
Copy link
Author

Thanks @kuaashish
We will be waiting for an update

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform:ios MediaPipe IOS issues stat:awaiting googler Waiting for Google Engineer's Response task:LLM inference Issues related to MediaPipe LLM Inference Gen AI setup type:others issues not falling in bug, perfromance, support, build and install or feature
Projects
None yet
Development

No branches or pull requests

3 participants