Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update SA docs and command-line opts #1829

Merged
merged 2 commits into from
Dec 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/frontends/systolic-array.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ can be configured.

- `--top-length`, `--left-length`: The length of top and left sides of the systolic array.
- `--top-depth`, `--left-depth`: The length of the input streams from top and left sides of the array.
- `--post-op`: Specify the post operation to be performed on the result of the matrix-multiply.
- `--fixed-dim`: Generate systolic array that only processes matrices with the given sizes. The default strategy supports matrices with any contraction dimension.

[kung-systolic]: http://www.eecs.harvard.edu/~htk/publication/1982-kung-why-systolic-architecture.pdf
[systolic-lang]: https://github.com/calyxir/calyx/tree/master/frontends/systolic-lang
24 changes: 20 additions & 4 deletions frontends/systolic-lang/systolic_arg_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,30 @@ def parse_arguments(self):
"""

# Arg parsing
parser = argparse.ArgumentParser(description="Process some integers.")
parser = argparse.ArgumentParser(
description="Generate an output-stationary systolic array in Calyx."
)
parser.add_argument("file", nargs="?", type=str)
parser.add_argument("-tl", "--top-length", type=int)
parser.add_argument("-td", "--top-depth", type=int)
parser.add_argument("-ll", "--left-length", type=int)
parser.add_argument("-ld", "--left-depth", type=int)
parser.add_argument("-p", "--post-op", type=str, default=None)
parser.add_argument("-s", "--static", action="store_true")
parser.add_argument(
"-p",
"--post-op",
help="post operation to be performed on the matrix-multiply result",
type=str,
default=None,
)
parser.add_argument(
"--fixed-dim",
help=(
"systolic array that only processes fixed dimension matrices."
" By default, generated array can process matrices "
" with any contraction dimension"
),
action="store_true",
)

args = parser.parse_args()

Expand All @@ -38,7 +54,7 @@ def parse_arguments(self):
self.left_length = args.left_length
self.left_depth = args.left_depth
self.post_op = args.post_op
self.static = args.static
self.static = args.fixed_dim
elif args.file is not None:
with open(args.file, "r") as f:
spec = json.load(f)
Expand Down