3473 Commits

Author SHA1 Message Date
Alexander Shaposhnikov
a7d9560258 Remove spurious explicit and invalid constexpr.
LiteRT-PiperOrigin-RevId: 849322469
2025-12-26 18:59:05 -08:00
Google AI Edge
aaacec2896 This is an internal change
LiteRT-PiperOrigin-RevId: 849279059
2025-12-26 15:16:13 -08:00
Google AI Edge
27e34cd605 This is an internal change
LiteRT-PiperOrigin-RevId: 849278986
2025-12-26 15:13:07 -08:00
Google AI Edge
d3952c78b4 Properly handle has_builtin macro on certain gcc compiler
LiteRT-PiperOrigin-RevId: 849268648
2025-12-26 14:28:14 -08:00
Google AI Edge
096ef5912f Use GitHub mirror for BCR to work around bcr.bazel.build outages
LiteRT-PiperOrigin-RevId: 849267935
2025-12-26 14:24:49 -08:00
fujunwei
bc7fcbc9ea Use OpenVINO level zero remote tensor as LiteRT custom buffer
The performance of Gemma3 improved from 0.3 tokens/s to 71 tokens/s on
PTL.
2025-12-24 07:49:22 +08:00
Google AI Edge
32ec63ee89 This is an internal change
Reverts 7771eaecff29780eb0069082c2f6ac1d27a3af1e

PiperOrigin-RevId: 848262323
2025-12-23 12:27:21 -08:00
Copybara-Service
20c00d28b0 Merge pull request #5025 from graham0824:dev/chunhsue/add_missing_cmake_dep
LiteRT-PiperOrigin-RevId: 848227491
2025-12-23 10:42:09 -08:00
Google AI Edge
6b829c3919 Automated Code Change
PiperOrigin-RevId: 848073971
2025-12-23 01:32:12 -08:00
Chun-nien Chan
9faa4eae4a Add tfl quant propagation passes to model-utils
LiteRT-PiperOrigin-RevId: 848049860
2025-12-23 00:09:47 -08:00
Chun-nien Chan
9aad7a4de5 model-utils add extenral_const op
LiteRT-PiperOrigin-RevId: 847981237
2025-12-22 20:11:34 -08:00
Google AI Edge
7771eaecff This is an internal change
Reverts bb01f1a9736d45996115e28825e702858df83fc0

PiperOrigin-RevId: 847933822
2025-12-22 17:21:43 -08:00
Byungchul Kim
51b3f46565 Set FC's keep_num_dims to false when output dims is different from input dims after quantization.
On gemma3n with decode batch > 1, it happens when the embedding is coupled with PLE by einsum.
The export steps are:
1) Initial: BMM([b,2048]x[2048,7680] -> [b,7680])
2) FuseInputReshape_BatchMatMulWithFlattenedRhsDims: BMM([b,2048]x[2048,7680] -> [b,7680])
3) ConvertBatchMatMulOp2FullyConnectedOp_Rank2ConstantRhs: FC([b,2048]x[2048,7680] -> [b,7680])
4) StrictQuantizationPattern(by IsDrqTensor): FC([b,1,2048]x[2048,7680] -> [b,7680])

When FC's keep_num_dims is false and it's followed by reshape op (like gemma3n), keep_num_dims will be set to true later with correct shapes by EnableFullyConnectedKeepNumDimsBeforeReshape.

LiteRT-Converter-PiperOrigin-RevId: 847813526
2025-12-22 10:39:30 -08:00
Google AI Edge
9717538247 Migrates builder.create<Op>() => Op::create() in tablegen files
LiteRT-Converter-PiperOrigin-RevId: 847796796
2025-12-22 09:46:43 -08:00
Lu Wang
3cee187ce2 Update LiteRT Readme
LiteRT-PiperOrigin-RevId: 847588728
2025-12-21 21:21:15 -08:00
Quentin Khan
bb01f1a973 Use the XNNPack packing fingerprints to invalidate the weight cache.
PiperOrigin-RevId: 846914182
2025-12-19 17:00:33 -08:00
Chun-Hsueh Lee
34044db27d PR #4837: Qualcomm AI Engine Direct - Add QNN E-wise Max & Div INT16 tests.
Imported from GitHub PR https://github.com/google-ai-edge/LiteRT/pull/4837

Copybara import of the project:

--
12b5bfe82e5d1575df2b49e7dc819a88b5313b61 by chunhsue-qti <chunhsue@qti.qualcomm.com>:

Qualcomm AI Engine Direct - Add QNN E-wise Max & Div INT16 tests.

Co-Authored-By: William Lin <chengwl@qti.qualcomm.com>

Merging this change closes #4837

COPYBARA_INTEGRATE_REVIEW=https://github.com/google-ai-edge/LiteRT/pull/4837 from graham0824:dev/chunhsue/add_op_test 12b5bfe82e5d1575df2b49e7dc819a88b5313b61
LiteRT-PiperOrigin-RevId: 846884452
2025-12-19 15:19:31 -08:00
Google AI Edge
de28f7fcb7 Remove alpha reference and update project status
LiteRT-PiperOrigin-RevId: 846879237
2025-12-19 15:04:23 -08:00
Google AI Edge
1ea9670055 LiteRT DarwiNN: fix default device and memory power states
LiteRT-PiperOrigin-RevId: 846861434
2025-12-19 14:08:48 -08:00
Google AI Edge
bd5bf4866a Apply llvm-use-new-mlir-op-builder fixes
This migrates `builder.create<Op>()` => `Op::create()`

LiteRT-Converter-PiperOrigin-RevId: 846854812
2025-12-19 13:54:06 -08:00
Fengwu Yao
e0e0870385 Internal changes only.
PiperOrigin-RevId: 846835877
2025-12-19 12:56:21 -08:00
Andrew Zhang
506a5b0919 Rename rewriter to builder to reflect its nature.
LiteRT-PiperOrigin-RevId: 846830984
2025-12-19 12:40:20 -08:00
Byungchul Kim
d71bda6ca4 Internal changes only
LiteRT-PiperOrigin-RevId: 846804879
2025-12-19 11:22:58 -08:00
Google AI Edge
330b914b06 Refactor Google Tensor compiler API to pass SOC model via options proto.
The GoogleTensorCompileFlatbuffer API now receives the SOC model information embedded within the GoogleTensorOptions proto instead of as a separate argument. The compiler_plugin populates the GoogleTensorCompilerConfig within the options proto based on the provided SOC model string.

LiteRT-PiperOrigin-RevId: 846789694
2025-12-19 10:45:38 -08:00
Terry Heo
223a1a5ad2 Update LiteRT C++ API doc in Doxygen style
The change will be available via
https://ai.google.dev/edge/api/litert/c

LiteRT-PiperOrigin-RevId: 846788580
2025-12-19 10:40:52 -08:00
Google AI Edge
87404a99f1 Google Tensor Dispatch: support dma-bufs
LiteRT-PiperOrigin-RevId: 846781070
2025-12-19 10:19:50 -08:00
Quentin Khan
78dd9618ed Update tensorflow version to pull latest XNNPack
LiteRT-PiperOrigin-RevId: 846758641
2025-12-19 09:11:35 -08:00
Google AI Edge
521e9a2a88 Fix Google Tensor options check in compiler plugin.
- The check for the existence of Google Tensor options was incorrectly using `GetOpaqueOptions()` instead of `GetGoogleTensorOptions()`.

LiteRT-PiperOrigin-RevId: 846543576
2025-12-18 21:23:46 -08:00
chunhsue-qti
ec5815d6cd Qualcomm AI Engine Direct - Modify CMakeLists for test files.
Summary:
- Clean cmake dependencies for tests.
- Add missing dependency for tensor_wrapper_test.
2025-12-19 10:45:52 +08:00
Google AI Edge
cc8e105d23 Introduces APIs to ease registration of dma-bufs.
Also introduces an API (but not ABI) modification to thrRegisterBuffer when type == kThrBufferTypeDmaBuf, specifying that buffer is now a pointer to an fd, rather than directly containing an fd. This is to prevent clients from storing an int in a void*, which is implementation-defined behavior.

LiteRT-PiperOrigin-RevId: 846468851
2025-12-18 17:02:42 -08:00
Maxim Ermilov
6e9ea82125 switch from deprecated TF_CHECK_OK
LiteRT-Converter-PiperOrigin-RevId: 846448345
2025-12-18 15:59:54 -08:00
Google AI Edge
e1214bcaf6 Fix LiteRT.js only using 1 thread when multithreading is enabled
Also, add a `numThreads` option.

Additionally, fix a bug where the wrong options were passed when compiling the model, (hence the changes to other tests).

LiteRT-PiperOrigin-RevId: 846355706
2025-12-18 11:45:24 -08:00
Quentin Khan
6d574ae404 In FileDescriptor tests, improve temporary file path generation.
Depending on the compiler, `testing::TempDir() + __FUNCTION__` may generate and
invalid file name.

PiperOrigin-RevId: 846275995
2025-12-18 08:15:49 -08:00
Google AI Edge
016efb0545 Apply llvm-use-new-mlir-op-builder fixes
This migrates `builder.create<Op>()` => `Op::create()`

LiteRT-Converter-PiperOrigin-RevId: 846268375
2025-12-18 07:55:16 -08:00
Quentin Khan
aa807767ff When opening a file, check that the file path is not null.
PiperOrigin-RevId: 846221230
2025-12-18 05:33:19 -08:00
Quentin Khan
0e9172383f Update XNNPack version
PiperOrigin-RevId: 846213195
2025-12-18 05:07:48 -08:00
Quentin Khan
f91668e19d Add a function to check for empty/non existing files.
The `fd.Size()` check doesn't work when the file descriptor is invalid and only
the path was given.

PiperOrigin-RevId: 846207406
2025-12-18 04:48:55 -08:00
Google AI Edge
c16a9063b6 Automated Code Change
LiteRT-Converter-PiperOrigin-RevId: 846135593
2025-12-18 01:15:14 -08:00
Google AI Edge
0e99a6b6b6 Automated Code Change
PiperOrigin-RevId: 846037931
2025-12-17 20:32:38 -08:00
Tommy Chiang
519f94069b Add Intel OpenVINO litert_integration_test
This does not add `pre_compiled` test as it only contains the qualcomm model.
Additionally, `single_op_device_tests` is failing and may brick your device.
Thus, it is excluded as for now.

LiteRT-PiperOrigin-RevId: 846021174
2025-12-17 19:41:03 -08:00
Tommy Chiang
e22b587885 Add simple Intel OpenVino smoke test
This ensure we can run tests on PTL devices

LiteRT-PiperOrigin-RevId: 846004771
2025-12-17 18:58:09 -08:00
Fengwu Yao
2a4e7990fc Update to use half data type in Cast kernel.
PiperOrigin-RevId: 845989438
2025-12-17 18:00:34 -08:00
Andrew Zhang
d8420f28a6 Disable sanitizers since rewriter allocates and deallocates objects across ABI boundary.
LiteRT-PiperOrigin-RevId: 845979071
2025-12-17 17:19:37 -08:00
Copybara-Service
3505659ff7 Merge pull request #4862 from graham0824:dev/chunhsue/int2
LiteRT-PiperOrigin-RevId: 845975219
2025-12-17 17:07:50 -08:00
Google AI Edge
7a1e296e5d Bump LiteRT experimental version to 2.2.0.
LiteRT-PiperOrigin-RevId: 845957699
2025-12-17 16:14:00 -08:00
Fengwu Yao
771efc9a53 Update to use half data type in split.
PiperOrigin-RevId: 845906959
2025-12-17 14:00:46 -08:00
Misha Gutman
08e7a985e6 Supported int2 in xnnpack_delegate.
PiperOrigin-RevId: 845875757
2025-12-17 12:39:45 -08:00
Fengwu Yao
d6fae083fd Internal changes only.
PiperOrigin-RevId: 845873615
2025-12-17 12:33:12 -08:00
Matthew Chan
9d5a6170cd Add FunctionGemma model type and configuration.
LiteRT-PiperOrigin-RevId: 845864189
2025-12-17 12:05:54 -08:00
Google AI Edge
57e8c44664 Fix missing await in LiteRT.js readme
Also, remove unnecessary call to `await results[0].data();`

LiteRT-PiperOrigin-RevId: 845840907
2025-12-17 11:09:38 -08:00