gemma.cpp
/
BUILD.bazel
97 строк · 1.7 Кб
1# gemma.cpp is a lightweight, standalone C++ inference engine for the Gemma
2# foundation models from Google.
3
4load("@rules_license//rules:license.bzl", "license")
5
6package(
7default_applicable_licenses = ["//:license"],
8default_visibility = ["//visibility:public"],
9)
10
11license(
12name = "license",
13package_name = "gemma_cpp",
14)
15
16# Dual-licensed Apache 2 and 3-clause BSD.
17licenses(["notice"])
18
19exports_files(["LICENSE"])
20
21cc_library(
22name = "transformer_ops",
23hdrs = [
24"ops.h",
25],
26deps = [
27"//compression:compress",
28"@hwy//:algo",
29"@hwy//:dot",
30"@hwy//:hwy",
31"@hwy//:math",
32"@hwy//:matvec",
33"@hwy//:profiler",
34"@hwy//:thread_pool",
35"@hwy//hwy/contrib/sort:vqsort",
36],
37)
38
39cc_library(
40name = "args",
41hdrs = [
42"util/args.h",
43],
44deps = [
45"@hwy//:hwy",
46],
47)
48
49cc_library(
50name = "app",
51hdrs = [
52"util/app.h",
53],
54deps = [
55":args",
56"@hwy//:hwy",
57],
58)
59
60cc_library(
61name = "gemma_lib",
62srcs = [
63"gemma.cc",
64],
65hdrs = [
66"configs.h",
67"gemma.h",
68],
69deps = [
70":args",
71":transformer_ops",
72"//compression:compress",
73"@hwy//:hwy",
74"@hwy//:matvec",
75"@hwy//:nanobenchmark", # timer
76"@hwy//:profiler",
77"@hwy//:thread_pool",
78"@com_google_sentencepiece//:sentencepiece_processor",
79],
80)
81
82cc_binary(
83name = "gemma",
84srcs = [
85"run.cc",
86],
87deps = [
88":app",
89":args",
90":gemma_lib",
91"//compression:compress",
92"@hwy//:hwy",
93"@hwy//:nanobenchmark",
94"@hwy//:profiler",
95"@hwy//:thread_pool",
96],
97)
98