├── .github └── workflows │ ├── ci.yml │ └── pre-commit.yml ├── .gitignore ├── .pre-commit-config.yaml ├── LICENSE ├── README.md ├── VERSION_NUMBER ├── dev_requirements.txt ├── examples └── gpt2.py ├── fleet_compiler ├── __init__.py ├── frontend │ ├── __init__.py │ ├── ast.py │ ├── dtype.py │ ├── error.py │ ├── indentation.py │ ├── lexer.py │ ├── operators │ │ ├── __init__.py │ │ ├── numpy │ │ │ ├── __init__.py │ │ │ ├── ops.py │ │ │ └── random │ │ │ │ ├── __init__.py │ │ │ │ └── ops.py │ │ └── python │ │ │ ├── __init__.py │ │ │ ├── ops.py │ │ │ └── time │ │ │ ├── __init__.py │ │ │ └── ops.py │ ├── ops.py │ ├── parsing.py │ ├── pass_manager.py │ ├── runtime.py │ ├── scope.py │ ├── semantic.py │ └── symbolic.py ├── ir │ ├── __init__.py │ ├── builder.py │ ├── core.py │ ├── dialects │ │ ├── __init__.py │ │ ├── arith.py │ │ ├── builtin.py │ │ ├── func.py │ │ ├── math.py │ │ ├── numpy.py │ │ ├── python.py │ │ ├── tensor.py │ │ ├── tosa.py │ │ └── vm.py │ ├── importer.py │ ├── interfaces.py │ ├── pass_manager.py │ ├── pattern_rewriter.py │ ├── printer.py │ ├── traits.py │ └── transforms │ │ ├── __init__.py │ │ ├── canonicalize.py │ │ ├── canonicalize_patterns │ │ ├── __init__.py │ │ ├── tosa.py │ │ └── vm.py │ │ ├── convert_arith_to_vm.py │ │ ├── convert_math_to_vm.py │ │ ├── convert_tensor_to_vm.py │ │ ├── convert_tosa_to_vm.py │ │ ├── dce.py │ │ ├── inline.py │ │ ├── lower_numpy.py │ │ ├── set_target_info.py │ │ └── shape_inference.py ├── tools │ └── cli.py └── vm │ ├── __init__.py │ ├── bytecode.py │ ├── dispatch.py │ └── vm.py ├── requirements.txt ├── setup.py └── tests ├── mlir ├── lit.cfg.py ├── test_bc.py ├── test_binary_ops.py ├── test_func.py ├── test_gpt2_bc.py ├── test_gpt2_mlir.py ├── test_lower_numpy.py ├── test_np_random_randn.py ├── test_shape_inference.py ├── test_variable_decl.py └── test_vm.py ├── python ├── test_builtin.py ├── test_expression.py ├── test_numpy.py ├── test_syntax.py └── utils.py └── test_lit.py.bak /.github/workflows/ci.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexshuang/fleet-compiler/HEAD/.github/workflows/ci.yml -------------------------------------------------------------------------------- /.github/workflows/pre-commit.yml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexshuang/fleet-compiler/HEAD/.github/workflows/pre-commit.yml -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexshuang/fleet-compiler/HEAD/.gitignore -------------------------------------------------------------------------------- /.pre-commit-config.yaml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexshuang/fleet-compiler/HEAD/.pre-commit-config.yaml -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexshuang/fleet-compiler/HEAD/LICENSE -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexshuang/fleet-compiler/HEAD/README.md -------------------------------------------------------------------------------- /VERSION_NUMBER: -------------------------------------------------------------------------------- 1 | 0.1 -------------------------------------------------------------------------------- /dev_requirements.txt: -------------------------------------------------------------------------------- 1 | -e . 2 | pytest 3 | pre-commit 4 | lit 5 | -------------------------------------------------------------------------------- /examples/gpt2.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexshuang/fleet-compiler/HEAD/examples/gpt2.py -------------------------------------------------------------------------------- /fleet_compiler/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /fleet_compiler/frontend/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /fleet_compiler/frontend/ast.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexshuang/fleet-compiler/HEAD/fleet_compiler/frontend/ast.py -------------------------------------------------------------------------------- /fleet_compiler/frontend/dtype.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexshuang/fleet-compiler/HEAD/fleet_compiler/frontend/dtype.py -------------------------------------------------------------------------------- /fleet_compiler/frontend/error.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexshuang/fleet-compiler/HEAD/fleet_compiler/frontend/error.py -------------------------------------------------------------------------------- /fleet_compiler/frontend/indentation.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexshuang/fleet-compiler/HEAD/fleet_compiler/frontend/indentation.py -------------------------------------------------------------------------------- /fleet_compiler/frontend/lexer.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexshuang/fleet-compiler/HEAD/fleet_compiler/frontend/lexer.py -------------------------------------------------------------------------------- /fleet_compiler/frontend/operators/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /fleet_compiler/frontend/operators/numpy/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /fleet_compiler/frontend/operators/numpy/ops.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexshuang/fleet-compiler/HEAD/fleet_compiler/frontend/operators/numpy/ops.py -------------------------------------------------------------------------------- /fleet_compiler/frontend/operators/numpy/random/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /fleet_compiler/frontend/operators/numpy/random/ops.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexshuang/fleet-compiler/HEAD/fleet_compiler/frontend/operators/numpy/random/ops.py -------------------------------------------------------------------------------- /fleet_compiler/frontend/operators/python/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /fleet_compiler/frontend/operators/python/ops.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexshuang/fleet-compiler/HEAD/fleet_compiler/frontend/operators/python/ops.py -------------------------------------------------------------------------------- /fleet_compiler/frontend/operators/python/time/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /fleet_compiler/frontend/operators/python/time/ops.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexshuang/fleet-compiler/HEAD/fleet_compiler/frontend/operators/python/time/ops.py -------------------------------------------------------------------------------- /fleet_compiler/frontend/ops.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexshuang/fleet-compiler/HEAD/fleet_compiler/frontend/ops.py -------------------------------------------------------------------------------- /fleet_compiler/frontend/parsing.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexshuang/fleet-compiler/HEAD/fleet_compiler/frontend/parsing.py -------------------------------------------------------------------------------- /fleet_compiler/frontend/pass_manager.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexshuang/fleet-compiler/HEAD/fleet_compiler/frontend/pass_manager.py -------------------------------------------------------------------------------- /fleet_compiler/frontend/runtime.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexshuang/fleet-compiler/HEAD/fleet_compiler/frontend/runtime.py -------------------------------------------------------------------------------- /fleet_compiler/frontend/scope.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexshuang/fleet-compiler/HEAD/fleet_compiler/frontend/scope.py -------------------------------------------------------------------------------- /fleet_compiler/frontend/semantic.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexshuang/fleet-compiler/HEAD/fleet_compiler/frontend/semantic.py -------------------------------------------------------------------------------- /fleet_compiler/frontend/symbolic.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexshuang/fleet-compiler/HEAD/fleet_compiler/frontend/symbolic.py -------------------------------------------------------------------------------- /fleet_compiler/ir/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /fleet_compiler/ir/builder.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexshuang/fleet-compiler/HEAD/fleet_compiler/ir/builder.py -------------------------------------------------------------------------------- /fleet_compiler/ir/core.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexshuang/fleet-compiler/HEAD/fleet_compiler/ir/core.py -------------------------------------------------------------------------------- /fleet_compiler/ir/dialects/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /fleet_compiler/ir/dialects/arith.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexshuang/fleet-compiler/HEAD/fleet_compiler/ir/dialects/arith.py -------------------------------------------------------------------------------- /fleet_compiler/ir/dialects/builtin.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexshuang/fleet-compiler/HEAD/fleet_compiler/ir/dialects/builtin.py -------------------------------------------------------------------------------- /fleet_compiler/ir/dialects/func.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexshuang/fleet-compiler/HEAD/fleet_compiler/ir/dialects/func.py -------------------------------------------------------------------------------- /fleet_compiler/ir/dialects/math.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexshuang/fleet-compiler/HEAD/fleet_compiler/ir/dialects/math.py -------------------------------------------------------------------------------- /fleet_compiler/ir/dialects/numpy.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexshuang/fleet-compiler/HEAD/fleet_compiler/ir/dialects/numpy.py -------------------------------------------------------------------------------- /fleet_compiler/ir/dialects/python.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexshuang/fleet-compiler/HEAD/fleet_compiler/ir/dialects/python.py -------------------------------------------------------------------------------- /fleet_compiler/ir/dialects/tensor.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexshuang/fleet-compiler/HEAD/fleet_compiler/ir/dialects/tensor.py -------------------------------------------------------------------------------- /fleet_compiler/ir/dialects/tosa.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexshuang/fleet-compiler/HEAD/fleet_compiler/ir/dialects/tosa.py -------------------------------------------------------------------------------- /fleet_compiler/ir/dialects/vm.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexshuang/fleet-compiler/HEAD/fleet_compiler/ir/dialects/vm.py -------------------------------------------------------------------------------- /fleet_compiler/ir/importer.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexshuang/fleet-compiler/HEAD/fleet_compiler/ir/importer.py -------------------------------------------------------------------------------- /fleet_compiler/ir/interfaces.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexshuang/fleet-compiler/HEAD/fleet_compiler/ir/interfaces.py -------------------------------------------------------------------------------- /fleet_compiler/ir/pass_manager.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexshuang/fleet-compiler/HEAD/fleet_compiler/ir/pass_manager.py -------------------------------------------------------------------------------- /fleet_compiler/ir/pattern_rewriter.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexshuang/fleet-compiler/HEAD/fleet_compiler/ir/pattern_rewriter.py -------------------------------------------------------------------------------- /fleet_compiler/ir/printer.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexshuang/fleet-compiler/HEAD/fleet_compiler/ir/printer.py -------------------------------------------------------------------------------- /fleet_compiler/ir/traits.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexshuang/fleet-compiler/HEAD/fleet_compiler/ir/traits.py -------------------------------------------------------------------------------- /fleet_compiler/ir/transforms/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /fleet_compiler/ir/transforms/canonicalize.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexshuang/fleet-compiler/HEAD/fleet_compiler/ir/transforms/canonicalize.py -------------------------------------------------------------------------------- /fleet_compiler/ir/transforms/canonicalize_patterns/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /fleet_compiler/ir/transforms/canonicalize_patterns/tosa.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexshuang/fleet-compiler/HEAD/fleet_compiler/ir/transforms/canonicalize_patterns/tosa.py -------------------------------------------------------------------------------- /fleet_compiler/ir/transforms/canonicalize_patterns/vm.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexshuang/fleet-compiler/HEAD/fleet_compiler/ir/transforms/canonicalize_patterns/vm.py -------------------------------------------------------------------------------- /fleet_compiler/ir/transforms/convert_arith_to_vm.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexshuang/fleet-compiler/HEAD/fleet_compiler/ir/transforms/convert_arith_to_vm.py -------------------------------------------------------------------------------- /fleet_compiler/ir/transforms/convert_math_to_vm.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexshuang/fleet-compiler/HEAD/fleet_compiler/ir/transforms/convert_math_to_vm.py -------------------------------------------------------------------------------- /fleet_compiler/ir/transforms/convert_tensor_to_vm.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexshuang/fleet-compiler/HEAD/fleet_compiler/ir/transforms/convert_tensor_to_vm.py -------------------------------------------------------------------------------- /fleet_compiler/ir/transforms/convert_tosa_to_vm.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexshuang/fleet-compiler/HEAD/fleet_compiler/ir/transforms/convert_tosa_to_vm.py -------------------------------------------------------------------------------- /fleet_compiler/ir/transforms/dce.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexshuang/fleet-compiler/HEAD/fleet_compiler/ir/transforms/dce.py -------------------------------------------------------------------------------- /fleet_compiler/ir/transforms/inline.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexshuang/fleet-compiler/HEAD/fleet_compiler/ir/transforms/inline.py -------------------------------------------------------------------------------- /fleet_compiler/ir/transforms/lower_numpy.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexshuang/fleet-compiler/HEAD/fleet_compiler/ir/transforms/lower_numpy.py -------------------------------------------------------------------------------- /fleet_compiler/ir/transforms/set_target_info.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexshuang/fleet-compiler/HEAD/fleet_compiler/ir/transforms/set_target_info.py -------------------------------------------------------------------------------- /fleet_compiler/ir/transforms/shape_inference.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexshuang/fleet-compiler/HEAD/fleet_compiler/ir/transforms/shape_inference.py -------------------------------------------------------------------------------- /fleet_compiler/tools/cli.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexshuang/fleet-compiler/HEAD/fleet_compiler/tools/cli.py -------------------------------------------------------------------------------- /fleet_compiler/vm/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /fleet_compiler/vm/bytecode.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexshuang/fleet-compiler/HEAD/fleet_compiler/vm/bytecode.py -------------------------------------------------------------------------------- /fleet_compiler/vm/dispatch.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexshuang/fleet-compiler/HEAD/fleet_compiler/vm/dispatch.py -------------------------------------------------------------------------------- /fleet_compiler/vm/vm.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexshuang/fleet-compiler/HEAD/fleet_compiler/vm/vm.py -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | numpy 2 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexshuang/fleet-compiler/HEAD/setup.py -------------------------------------------------------------------------------- /tests/mlir/lit.cfg.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexshuang/fleet-compiler/HEAD/tests/mlir/lit.cfg.py -------------------------------------------------------------------------------- /tests/mlir/test_bc.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexshuang/fleet-compiler/HEAD/tests/mlir/test_bc.py -------------------------------------------------------------------------------- /tests/mlir/test_binary_ops.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexshuang/fleet-compiler/HEAD/tests/mlir/test_binary_ops.py -------------------------------------------------------------------------------- /tests/mlir/test_func.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexshuang/fleet-compiler/HEAD/tests/mlir/test_func.py -------------------------------------------------------------------------------- /tests/mlir/test_gpt2_bc.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexshuang/fleet-compiler/HEAD/tests/mlir/test_gpt2_bc.py -------------------------------------------------------------------------------- /tests/mlir/test_gpt2_mlir.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexshuang/fleet-compiler/HEAD/tests/mlir/test_gpt2_mlir.py -------------------------------------------------------------------------------- /tests/mlir/test_lower_numpy.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexshuang/fleet-compiler/HEAD/tests/mlir/test_lower_numpy.py -------------------------------------------------------------------------------- /tests/mlir/test_np_random_randn.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexshuang/fleet-compiler/HEAD/tests/mlir/test_np_random_randn.py -------------------------------------------------------------------------------- /tests/mlir/test_shape_inference.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexshuang/fleet-compiler/HEAD/tests/mlir/test_shape_inference.py -------------------------------------------------------------------------------- /tests/mlir/test_variable_decl.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexshuang/fleet-compiler/HEAD/tests/mlir/test_variable_decl.py -------------------------------------------------------------------------------- /tests/mlir/test_vm.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexshuang/fleet-compiler/HEAD/tests/mlir/test_vm.py -------------------------------------------------------------------------------- /tests/python/test_builtin.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexshuang/fleet-compiler/HEAD/tests/python/test_builtin.py -------------------------------------------------------------------------------- /tests/python/test_expression.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexshuang/fleet-compiler/HEAD/tests/python/test_expression.py -------------------------------------------------------------------------------- /tests/python/test_numpy.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexshuang/fleet-compiler/HEAD/tests/python/test_numpy.py -------------------------------------------------------------------------------- /tests/python/test_syntax.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexshuang/fleet-compiler/HEAD/tests/python/test_syntax.py -------------------------------------------------------------------------------- /tests/python/utils.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexshuang/fleet-compiler/HEAD/tests/python/utils.py -------------------------------------------------------------------------------- /tests/test_lit.py.bak: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/alexshuang/fleet-compiler/HEAD/tests/test_lit.py.bak --------------------------------------------------------------------------------