forked from modular/modular
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBUILD.bazel
More file actions
82 lines (75 loc) · 1.83 KB
/
BUILD.bazel
File metadata and controls
82 lines (75 loc) · 1.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
load("//bazel:api.bzl", "mojo_library", "requirement")
load(":custom_op_example.bzl", "custom_op_example_py_binary")
package(default_visibility = ["//visibility:private"])
filegroup(
name = "kernel_sources",
srcs = glob(["operations/*.mojo"]),
)
custom_op_example_py_binary(
name = "addition",
srcs = ["addition.py"],
extra_data = [
":operations",
],
deps = [
"//max/python/max/torch",
requirement("torch"),
],
)
custom_op_example_py_binary(
name = "grayscale",
srcs = ["grayscale.py"],
extra_data = [
":operations",
],
# TODO(GEX-3151): Investigate and enable on macOS
target_compatible_with = select({
"@platforms//os:macos": ["@platforms//:incompatible"],
"//conditions:default": [],
}),
deps = [
"//max/python/max/torch",
requirement("numpy"),
requirement("torch"),
requirement("pillow"),
],
)
custom_op_example_py_binary(
name = "whisper",
srcs = ["whisper.py"],
create_test = False,
extra_data = [
":operations",
],
deps = [
"//max/python/max/torch",
requirement("torch"),
requirement("transformers"),
requirement("datasets"),
],
)
custom_op_example_py_binary(
name = "graph",
srcs = ["graph.py"],
# TODO(GEX-3151): Investigate and enable on macOS
target_compatible_with = select({
"@platforms//os:macos": ["@platforms//:incompatible"],
"//conditions:default": [],
}),
deps = [
"//max/python/max/graph",
"//max/python/max/torch",
requirement("torch"),
],
)
mojo_library(
name = "operations",
srcs = [":kernel_sources"],
validate_missing_docs = False,
deps = [
"//max:compiler",
"//max:layout",
"//max:tensor",
"@mojo//:std",
],
)