{"id":13568442,"url":"https://github.com/google/gemmlowp","last_synced_at":"2025-10-21T05:25:13.519Z","repository":{"id":34673714,"uuid":"38646625","full_name":"google/gemmlowp","owner":"google","description":"Low-precision matrix multiplication","archived":false,"fork":false,"pushed_at":"2024-01-29T14:40:32.000Z","size":3651,"stargazers_count":1817,"open_issues_count":18,"forks_count":457,"subscribers_count":106,"default_branch":"master","last_synced_at":"2025-10-19T01:10:23.280Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/google.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS","dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-07-06T21:15:00.000Z","updated_at":"2025-10-12T01:58:30.000Z","dependencies_parsed_at":"2024-11-05T00:41:35.026Z","dependency_job_id":null,"html_url":"https://github.com/google/gemmlowp","commit_stats":{"total_commits":522,"total_committers":68,"mean_commits":7.676470588235294,"dds":"0.49425287356321834","last_synced_commit":"08e4bb339e34017a0835269d4a37c4ea04d15a69"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/google/gemmlowp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google%2Fgemmlowp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google%2Fgemmlowp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google%2Fgemmlowp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google%2Fgemmlowp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/google","download_url":"https://codeload.github.com/google/gemmlowp/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google%2Fgemmlowp/sbom","scorecard":{"id":436976,"data":{"date":"2025-08-11","repo":{"name":"github.com/google/gemmlowp","commit":"16e8662c34917be0065110bfcd9cc27d30f52fdf"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4.7,"checks":[{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Code-Review","score":6,"reason":"Found 19/29 approved changesets -- score normalized to 6","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Security-Policy","score":10,"reason":"security policy file detected","details":["Info: security policy file detected: github.com/google/.github/SECURITY.md:1","Info: Found linked content: github.com/google/.github/SECURITY.md:1","Info: Found disclosure, vulnerability, and/or timelines in security policy: github.com/google/.github/SECURITY.md:1","Info: Found text in security policy: github.com/google/.github/SECURITY.md:1"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 20 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-19T04:55:24.170Z","repository_id":34673714,"created_at":"2025-08-19T04:55:24.170Z","updated_at":"2025-08-19T04:55:24.170Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280018292,"owners_count":26259361,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-20T02:00:06.978Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T14:00:25.944Z","updated_at":"2025-10-21T05:25:13.488Z","avatar_url":"https://github.com/google.png","language":"C++","readme":"# gemmlowp: a small self-contained low-precision GEMM library\n\n[![Build Status](https://secure.travis-ci.org/google/gemmlowp.png)](http://travis-ci.org/google/gemmlowp)\n\nThis is not a full linear algebra library, only a GEMM library: it only does\ngeneral matrix multiplication (\"GEMM\").\n\nThe meaning of \"low precision\" is detailed in this document:\n[doc/low-precision.md](doc/low-precision.md)\n\nSome of the general design is explained in [doc/design.md](doc/design.md).\n\n**Warning:** This library goes very slow if compiled incorrectly; see below.\n\n## Disclaimer\n\nThis is not an official Google product (experimental or otherwise), it is just\ncode that happens to be owned by Google.\n\n## Mailing list\n\ngemmlowp-related discussion, about either development or usage, is welcome on\nthis Google Group (mailing list / forum):\n\nhttps://groups.google.com/forum/#!forum/gemmlowp\n\n## Portability, target platforms/architectures\n\nShould be portable to any platform with some C++11 and POSIX support, while we\nhave optional optimized code paths for specific architectures.\n\nRequired:\n\n*   C++11 (a small conservative subset of it)\n\nRequired for some features:\n\n*   Some POSIX interfaces:\n    *   pthreads (for multi-threaded operation and for profiling).\n    *   sysconf (for multi-threaded operation to detect number of cores; may be\n        bypassed).\n\nOptional:\n\n*   Architecture-specific code paths use intrinsics or inline assembly. See\n    \"Architecture-specific optimized code paths\" below.\n\n## Architecture-specific optimized code paths\n\nWe have some optimized code paths for specific instruction sets. Some are\nwritten in inline assembly, some are written in C++ using intrinsics. Both GCC\nand Clang are supported.\n\nCurrent optimized code paths:\n\n*   ARM with NEON (both 32bit and 64bit).\n*   Intel x86 with SSE 4.1 (both 32bit and 64bit).\n\nWhen building for x86, it's very important to pass `-msse4.1` to the compiler,\notherwise gemmlowp will use slow reference code. Bazel users can compile by\nrunning `bazel build --copt=-msse4.1 //gemmlowp:all`. The compiled binary should\nwork on all Intel CPUs since 2008 (including low power microarchitectures) as\nwell as AMD CPUs since 2011.\n\nPlease note when compiling binaries that don't need to be distributed, it's\ngenerally a better idea to pass `-march=native` to the compiler. That flag\nimplies `-msse4.1` flag, along with others that might be helpful. This of course\nassumes the host machine supports those instructions. Bazel users should prefer\nto run `bazel build --config=opt //gemmlowp:all` instead.\n\nDetails of what it takes to make an efficient port of gemmlowp, namely writing a\nsuitable GEMM kernel and accompanying packing code, are explained in this file:\n[doc/kernel.md](doc/kernel.md).\n\n## Public interfaces\n\n### The gemmlowp public interface\n\ngemmlowp's main public interface is in the `public/` subdirectory.\n\nThis is a headers-only library, so there is nothing to link to.\n\nUsage documentation, and comments on the deprecation status of each public entry\npoint, may be found in [doc/public.md](doc/public.md) .\n\nA full, self-contained usage example, showing how to quantize float matrices and\nperform a quantized matrix multiplication approximating a float matrix\nmultiplication, is given in\n[doc/quantization_example.cc](doc/quantization_example.cc).\n\n### Old EightBitIntGemm legacy deprecated interface\n\nThe `eight_bit_int_gemm/` subdirectory contains an alternate interface that\nshould be considered purely legacy, deprecated, and going to be removed at some\npoint in the future.\n\n## Building\n\n### Building by manually invoking your compiler\n\nBecause gemmlowp is so simple, working with it involves only single-command-line\ncompiler invocations. Therefore we expect that most people working with gemmlowp\nwill either manually invoke their compiler, or write their own rules for their\nown preferred build system.\n\nKeep in mind (previous section) that gemmlowp itself is a pure-headers-only\nlibrary so there is nothing to build.\n\nFor a Android gemmlowp development workflow, the `scripts/` directory contains a\nscript to build and run a program on an Android device:\n\n```\nscripts/test-android.sh\n```\n\n### Building using Bazel\n\nThat being said, we also maintain a Bazel BUILD system as part of gemmlowp. Its\nusage is not mandatory at all and is only one possible way that gemmlowp\nlibraries and tests may be built. If you are interested, Bazel's home page is\nhttp://bazel.build/ And you can get started with using Bazel to build gemmlowp\ntargets by first creating an empty WORKSPACE file in a parent directory, for\ninstance:\n\n```\n$ cd gemmlowp/..  # change to parent directory containing gemmlowp/\n$ touch WORKSPACE # declare that to be our workspace root\n$ bazel build gemmlowp:all\n```\n\n### Building gemmlowp - Using vcpkg\n\nYou can download and install gemmlowp using the [vcpkg](https://github.com/Microsoft/vcpkg) dependency manager:\n\n    git clone https://github.com/Microsoft/vcpkg.git\n    cd vcpkg\n    ./bootstrap-vcpkg.sh\n    ./vcpkg integrate install\n    ./vcpkg install gemmlowp\n\nThe gemmlowp port in vcpkg is kept up to date by Microsoft team members and community contributors. If the version is out of date, please [create an issue or pull request](https://github.com/Microsoft/vcpkg) on the vcpkg repository.\n\n## Testing\n\n### Testing by manually building and running tests\n\nThe test/ directory contains unit tests. The primary unit test is\n\n```\ntest/test.cc\n```\n\nSince it covers also the EightBitIntGemm interface, it needs to be linked\nagainst\n\n```\neight_bit_int_gemm/eight_bit_int_gemm.cc\n```\n\nIt also uses realistic data captured from a neural network run in\n\n```\ntest/test_data.cc\n```\n\nThus you'll want to pass the following list of source files to your\ncompiler/linker:\n\n```\ntest/test.cc\neight_bit_int_gemm/eight_bit_int_gemm.cc\ntest/test_data.cc\n```\n\nThe `scripts/` directory contains a script to build and run a program on an\nAndroid device:\n\n```\nscripts/test-android.sh\n```\n\nIt expects the `CXX` environment variable to point to an Android toolchain's C++\ncompiler, and expects source files (and optionally, cflags) as command-line\nparameters. To build and run the above-mentioned main unit test, first set `CXX`\ne.g.:\n\n```\n$ export CXX=/some/toolchains/arm-linux-androideabi-4.8/bin/arm-linux-androideabi-g++\n```\n\nThen run:\n\n```\n$ ./scripts/test-android.sh \\\ntest/test.cc \\\neight_bit_int_gemm/eight_bit_int_gemm.cc \\\ntest/test_data.cc\n```\n\n### Testing using Bazel\n\nAlternatively, you can use Bazel to build and run tests. See the Bazel\ninstruction in the above section on building. Once your Bazel workspace is set\nup, you can for instance do:\n\n```\n$ bazel test gemmlowp:all\n```\n\n## Troubleshooting Compilation\n\nIf you're having trouble finding the compiler, follow these instructions to\nbuild a standalone toolchain:\nhttps://developer.android.com/ndk/guides/standalone_toolchain.html\n\nHere's an example of setting up Clang 3.5:\n\n```\n$ export INSTALL_DIR=~/toolchains/clang-21-stl-gnu\n$ $NDK/build/tools/make-standalone-toolchain.sh \\\n--toolchain=arm-linux-androideabi-clang3.5 --platform=android-21 \\\n--install-dir=$INSTALL_DIR\n$ export CXX=\"$INSTALL_DIR/bin/arm-linux-androideabi-g++ \\\n--sysroot=$INSTALL_DIR/sysroot\"\n```\n\nSome compilers (e.g. the default clang++ in the same bin directory) don't\nsupport NEON assembly. The benchmark build process will issue a warning if\nsupport isn't detected, and you should make sure you're using a compiler like\narm-linux-androideabi-g++ that does include NEON.\n\n## Benchmarking\n\nThe main benchmark is\n\n```\ntest/benchmark.cc\n```\n\nIt doesn't need to be linked to any other source file. We recommend building\nwith assertions disabled (`-DNDEBUG`).\n\nFor example, the benchmark can be built and run on an Android device by doing:\n\n```\n$ ./scripts/test-android.sh test/benchmark.cc -DNDEBUG\n```\n\nIf `GEMMLOWP_TEST_PROFILE` is defined then the benchmark will be built with\nprofiling instrumentation (which makes it slower) and will dump profiles. See\nnext section on profiling.\n\n## Profiling\n\nThe `profiling/` subdirectory offers a very simple, naive, inaccurate,\nnon-interrupting sampling profiler that only requires pthreads (no signals).\n\nIt relies on source code being instrumented with pseudo-stack labels. See\n`profiling/instrumentation.h`. A full example of using this profiler is given in\nthe top comment of `profiling/profiler.h`.\n\n## Contributing\n\nContribution-related discussion is always welcome on the gemmlowp mailing list\n(see above).\n\nWe try to keep a current list of TODO items in the `todo/` directory.\nProspective contributors are welcome to pick one to work on, and communicate\nabout it on the gemmlowp mailing list.\n\nDetails of the contributing process, including legalese, are in CONTRIBUTING.\n\n## Performance goals\n\nOur performance goals differ from typical GEMM performance goals in the\nfollowing ways:\n\n1.  We care not only about speed, but also about minimizing power usage. We\n    specifically care about charge usage in mobile/embedded devices. This\n    implies that we care doubly about minimizing memory bandwidth usage: we care\n    about it, like any GEMM, because of the impact on speed, and we also care\n    about it because it is a key factor of power usage.\n\n2.  Most GEMMs are optimized primarily for large dense matrix sizes (\u003e= 1000).\n    We do care about large sizes, but we also care specifically about the\n    typically smaller matrix sizes encountered in various mobile applications.\n    This means that we have to optimize for all sizes, not just for large enough\n    sizes.\n","funding_links":[],"categories":["Maths","Libraries 🗂️","Projects built with Bazel"],"sub_categories":["CPU Libraries 💻","Google projects"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoogle%2Fgemmlowp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgoogle%2Fgemmlowp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoogle%2Fgemmlowp/lists"}