Skip to content

Commit

Permalink
Update SA docs and command-line opts (#1829)
Browse files Browse the repository at this point in the history
  • Loading branch information
rachitnigam authored Dec 26, 2023
1 parent 7170cca commit ecf8c8b
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 deletions.
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

0 comments on commit ecf8c8b

Please sign in to comment.