@@ -96,21 +96,27 @@ defmodule Emily.ConformanceHelper do
9696 suite's own `:*_full` moduletag; otherwise `--only native` would
9797 start pulling full-size checkpoints. `--only vit_full` then runs all
9898 three lanes of that suite.
99+
100+ * `:tag` — an extra tag stamped on *every* lane. Used by the
101+ `Nx.Serving` test, which lives in a `:conformance`-tagged module but
102+ must stay gated behind `:distilbert_full` like its eval lane:
103+ `tag: :distilbert_full, lane_tags: false`.
99104 """
100105 defmacro mode_test ( name , opts \\ [ ] , do: body ) do
101106 tag_lanes? = Keyword . get ( opts , :lane_tags , true )
107+ extra_tag = Keyword . get ( opts , :tag )
102108
103109 lanes = [
104- lane ( false , name , "" , [ ] , body ) ,
110+ lane ( [ extra_tag ] , name , "" , [ ] , body ) ,
105111 lane (
106- tag_lanes? && :native ,
112+ [ extra_tag , tag_lanes? && :native ] ,
107113 name ,
108114 " [native]" ,
109115 [ compiler: Emily.Compiler , native: true , native_fallback: :raise ] ,
110116 body
111117 ) ,
112118 lane (
113- tag_lanes? && :native_compiled ,
119+ [ extra_tag , tag_lanes? && :native_compiled ] ,
114120 name ,
115121 " [native_compiled]" ,
116122 [ compiler: Emily.Compiler , native: true , native_fallback: :raise , native_compiled: true ] ,
@@ -124,27 +130,25 @@ defmodule Emily.ConformanceHelper do
124130 end
125131
126132 # Build one `mode_test` lane: a `test` that binds `predict_opts` for the
127- # body, optionally preceded by `@tag tag`. `tag` is `false` to emit no
128- # lane tag (the `*_full` suites rely on their own `:*_full` moduletag).
129- defp lane ( tag , name , suffix , predict_opts , body ) do
133+ # body, preceded by one `@tag` per entry in `tags` (nil/false entries are
134+ # dropped). The `*_full` suites pass `lane_tags: false` to drop the
135+ # `:native` / `:native_compiled` tags and rely on their own `:*_full`
136+ # moduletag (or an explicit `:tag`) instead.
137+ defp lane ( tags , name , suffix , predict_opts , body ) do
138+ tags = Enum . reject ( tags , & ( & 1 in [ nil , false ] ) )
139+
130140 name_ast =
131141 if suffix == "" , do: name , else: quote ( do: unquote ( name ) <> unquote ( suffix ) )
132142
133- test =
134- quote do
135- test unquote ( name_ast ) do
136- var! ( predict_opts ) = unquote ( predict_opts )
137- unquote ( body )
138- end
139- end
143+ tag_attrs = for t <- tags , do: quote ( do: @ tag ( unquote ( t ) ) )
144+
145+ quote do
146+ ( unquote_splicing ( tag_attrs ) )
140147
141- if tag do
142- quote do
143- @ tag unquote ( tag )
144- unquote ( test )
148+ test unquote ( name_ast ) do
149+ var! ( predict_opts ) = unquote ( predict_opts )
150+ unquote ( body )
145151 end
146- else
147- test
148152 end
149153 end
150154
0 commit comments