Skip to content

Commit bb23a5e

Browse files
committed
spec 0.0.1 stable
1 parent 25f9f90 commit bb23a5e

6 files changed

Lines changed: 450 additions & 108 deletions

File tree

spec/schemas/combined.json

Lines changed: 277 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
},
1111
"content_type": {
1212
"const": "JSON",
13+
"enum": [
14+
"JSON"
15+
],
1316
"title": "Content Type",
1417
"type": "string"
1518
},
@@ -49,6 +52,9 @@
4952
},
5053
"content_type": {
5154
"const": "NDJSON",
55+
"enum": [
56+
"NDJSON"
57+
],
5258
"title": "Content Type",
5359
"type": "string"
5460
},
@@ -243,6 +249,274 @@
243249
"title": "Manifest",
244250
"type": "object"
245251
},
252+
"ops_entries": {
253+
"$defs": {
254+
"OpDynamicAttribute": {
255+
"properties": {
256+
"name": {
257+
"title": "Name",
258+
"type": "string"
259+
},
260+
"default_value": {
261+
"title": "Default Value",
262+
"type": "string"
263+
}
264+
},
265+
"required": [
266+
"name",
267+
"default_value"
268+
],
269+
"title": "OpDynamicAttribute",
270+
"type": "object"
271+
},
272+
"OpIO": {
273+
"properties": {
274+
"dtype": {
275+
"title": "Dtype",
276+
"type": "string"
277+
},
278+
"shape": {
279+
"items": {
280+
"anyOf": [
281+
{
282+
"type": "integer"
283+
},
284+
{
285+
"type": "string"
286+
}
287+
]
288+
},
289+
"title": "Shape",
290+
"type": "array"
291+
}
292+
},
293+
"required": [
294+
"dtype",
295+
"shape"
296+
],
297+
"title": "OpIO",
298+
"type": "object"
299+
},
300+
"OpInstance": {
301+
"properties": {
302+
"id": {
303+
"pattern": "^[a-zA-Z0-9_]+$",
304+
"title": "Id",
305+
"type": "string"
306+
},
307+
"op": {
308+
"title": "Op",
309+
"type": "string"
310+
},
311+
"inputs": {
312+
"items": {
313+
"$ref": "#/$defs/OpIO"
314+
},
315+
"title": "Inputs",
316+
"type": "array"
317+
},
318+
"outputs": {
319+
"items": {
320+
"$ref": "#/$defs/OpIO"
321+
},
322+
"title": "Outputs",
323+
"type": "array"
324+
},
325+
"attributes": {
326+
"title": "Attributes",
327+
"type": "object"
328+
},
329+
"dynamic_attributes": {
330+
"additionalProperties": {
331+
"$ref": "#/$defs/OpDynamicAttribute"
332+
},
333+
"title": "Dynamic Attributes",
334+
"type": "object"
335+
}
336+
},
337+
"required": [
338+
"id",
339+
"op",
340+
"inputs",
341+
"outputs",
342+
"attributes",
343+
"dynamic_attributes"
344+
],
345+
"title": "OpInstance",
346+
"type": "object"
347+
}
348+
},
349+
"properties": {
350+
"ops": {
351+
"items": {
352+
"$ref": "#/$defs/OpInstance"
353+
},
354+
"title": "Ops",
355+
"type": "array"
356+
}
357+
},
358+
"required": [
359+
"ops"
360+
],
361+
"title": "OpInstances",
362+
"type": "object"
363+
},
364+
"meta_entry": {
365+
"properties": {
366+
"id": {
367+
"title": "Id",
368+
"type": "string"
369+
},
370+
"producer": {
371+
"title": "Producer",
372+
"type": "string"
373+
},
374+
"producer_version": {
375+
"title": "Producer Version",
376+
"type": "string"
377+
},
378+
"producer_tags": {
379+
"items": {
380+
"type": "string"
381+
},
382+
"title": "Producer Tags",
383+
"type": "array"
384+
},
385+
"payload": {
386+
"title": "Payload",
387+
"type": "object"
388+
}
389+
},
390+
"required": [
391+
"id",
392+
"producer",
393+
"producer_version",
394+
"producer_tags",
395+
"payload"
396+
],
397+
"title": "MetaEntry",
398+
"type": "object"
399+
},
400+
"envs": {
401+
"python3::conda_pip": {
402+
"$defs": {
403+
"PipCondition": {
404+
"properties": {
405+
"platform": {
406+
"anyOf": [
407+
{
408+
"items": {
409+
"type": "string"
410+
},
411+
"type": "array"
412+
},
413+
{
414+
"type": "null"
415+
}
416+
],
417+
"default": null,
418+
"title": "Platform"
419+
},
420+
"os": {
421+
"anyOf": [
422+
{
423+
"items": {
424+
"type": "string"
425+
},
426+
"type": "array"
427+
},
428+
{
429+
"type": "null"
430+
}
431+
],
432+
"default": null,
433+
"title": "Os"
434+
},
435+
"acclerator": {
436+
"anyOf": [
437+
{
438+
"items": {
439+
"type": "string"
440+
},
441+
"type": "array"
442+
},
443+
{
444+
"type": "null"
445+
}
446+
],
447+
"default": null,
448+
"title": "Acclerator"
449+
}
450+
},
451+
"title": "PipCondition",
452+
"type": "object"
453+
},
454+
"PipDependency": {
455+
"properties": {
456+
"package": {
457+
"title": "Package",
458+
"type": "string"
459+
},
460+
"extra_pip_args": {
461+
"anyOf": [
462+
{
463+
"type": "string"
464+
},
465+
{
466+
"type": "null"
467+
}
468+
],
469+
"default": null,
470+
"title": "Extra Pip Args"
471+
},
472+
"condition": {
473+
"anyOf": [
474+
{
475+
"$ref": "#/$defs/PipCondition"
476+
},
477+
{
478+
"type": "null"
479+
}
480+
],
481+
"default": null
482+
}
483+
},
484+
"required": [
485+
"package"
486+
],
487+
"title": "PipDependency",
488+
"type": "object"
489+
}
490+
},
491+
"properties": {
492+
"python_version": {
493+
"title": "Python Version",
494+
"type": "string"
495+
},
496+
"build_dependencies": {
497+
"items": {
498+
"type": "string"
499+
},
500+
"title": "Build Dependencies",
501+
"type": "array"
502+
},
503+
"dependencies": {
504+
"items": {
505+
"$ref": "#/$defs/PipDependency"
506+
},
507+
"title": "Dependencies",
508+
"type": "array"
509+
}
510+
},
511+
"required": [
512+
"python_version",
513+
"build_dependencies",
514+
"dependencies"
515+
],
516+
"title": "Python3_CondaPip",
517+
"type": "object"
518+
}
519+
},
246520
"ops": {
247521
"ONNX_v1": {
248522
"$defs": {
@@ -350,6 +624,9 @@
350624
},
351625
"op": {
352626
"const": "ONNX_v1",
627+
"enum": [
628+
"ONNX_v1"
629+
],
353630
"title": "Op",
354631
"type": "string"
355632
},
@@ -390,73 +667,6 @@
390667
"type": "object"
391668
}
392669
},
393-
"meta_entry": {
394-
"properties": {
395-
"id": {
396-
"title": "Id",
397-
"type": "string"
398-
},
399-
"producer": {
400-
"title": "Producer",
401-
"type": "string"
402-
},
403-
"producer_version": {
404-
"title": "Producer Version",
405-
"type": "string"
406-
},
407-
"producer_tags": {
408-
"items": {
409-
"type": "string"
410-
},
411-
"title": "Producer Tags",
412-
"type": "array"
413-
},
414-
"payload": {
415-
"title": "Payload",
416-
"type": "object"
417-
}
418-
},
419-
"required": [
420-
"id",
421-
"producer",
422-
"producer_version",
423-
"producer_tags",
424-
"payload"
425-
],
426-
"title": "MetaEntry",
427-
"type": "object"
428-
},
429-
"envs": {
430-
"python3::conda_pip": {
431-
"properties": {
432-
"python_version": {
433-
"title": "Python Version",
434-
"type": "string"
435-
},
436-
"build_dependencies": {
437-
"items": {
438-
"type": "string"
439-
},
440-
"title": "Build Dependencies",
441-
"type": "array"
442-
},
443-
"dependencies": {
444-
"additionalProperties": {
445-
"type": "string"
446-
},
447-
"title": "Dependencies",
448-
"type": "object"
449-
}
450-
},
451-
"required": [
452-
"python_version",
453-
"build_dependencies",
454-
"dependencies"
455-
],
456-
"title": "Python3_CondaPip",
457-
"type": "object"
458-
}
459-
},
460670
"variants": {
461671
"pipeline": {
462672
"$defs": {

spec/schemas/src/generate.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
combined_json_schema = {
1818
"version": SPEC_VERSION,
1919
"manifest": manifest_json_schema,
20-
"ops": ops_json_schema,
20+
"ops_entries": ops_json_schema,
2121
"meta_entry": meta_entry_json_schema,
2222
"envs": {},
2323
"ops": {},

spec/schemas/src/pydantic_models/envs.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ class PipDependency(BaseModel):
1414

1515

1616
class Python3_CondaPip(BaseModel):
17+
# `python3::conda_pip`
1718
python_version: str
1819
build_dependencies: list[str]
19-
dependencies: dict[str, str]
20+
dependencies: list[PipDependency]

src/python/fnnx/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "0.0.3"
1+
__version__ = "0.0.4"

0 commit comments

Comments
 (0)