[litertlm] Fix stat() overflow for large models on Windows in LiteRT-LM JNI#2147
Merged
copybara-service[bot] merged 1 commit intomainfrom May 1, 2026
Merged
[litertlm] Fix stat() overflow for large models on Windows in LiteRT-LM JNI#2147copybara-service[bot] merged 1 commit intomainfrom
copybara-service[bot] merged 1 commit intomainfrom
Conversation
1f4b078 to
5d97a47
Compare
LiteRT-LM-PiperOrigin-RevId: 908892173
5d97a47 to
c258351
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
[litertlm] Fix stat() overflow for large models on Windows in LiteRT-LM JNI
Replaced raw stat() calls with FileExists utility from file_util.h in litertlm.cc.
stat() defaults to a 32-bit version on Windows (with UCRT/MSVCRT) which fails for files larger than 2GB (returning EOVERFLOW).
The FileExists utility uses std::filesystem::exists which is 64-bit safe.
Also updated BUILD file to depend on //third_party/odml/litert_lm/runtime/util:file_util.
Fixes #2000.