This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /////////////////////////////////////////////////////////////////////////////// | |
| // Author: Sai Machiraju | |
| // Course: ECE8893 - Parallel Programming for FPGAs | |
| // Filename: real_matmul.cpp | |
| // Description: Perform matrix multiplication with real values | |
| // | |
| // Note: You are free to modify this code to optimize your design. | |
| /////////////////////////////////////////////////////////////////////////////// | |
| #include "real.h" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import numpy as np | |
| import pynq | |
| overlay = pynq.Overlay('matmul.bit') | |
| top_ip = overlay.real_matmul_0 | |
| a_matrix = np.random.randint(10, size=(100, 150)) | |
| b_matrix = np.random.randint(10, size=(150, 200)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| +---------------------------------------------------------------------------------------+------+------+---------+-----------+----------+---------+------+----------+---------+-----------+-------------+-------------+-----+ | |
| | Modules | Issue| | Latency | Latency | Iteration| | Trip | | | | | | | | |
| | & Loops | Type | Slack| (cycles)| (ns) | Latency | Interval| Count| Pipelined| BRAM | DSP | FF | LUT | URAM| | |
| +---------------------------------------------------------------------------------------+------+------+---------+-----------+----------+---------+------+----------+---------+-----------+-------------+-------------+-----+ | |
| |+ real_matmul | -| 0.00| 787647| 7.876e+06| -| 7 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| +---------------------------------------------------------+------+------+---------+-----------+----------+---------+-------+----------+----------+---------+-----------+-----------+-----+ | |
| | Modules | Issue| | Latency | Latency | Iteration| | Trip | | | | | | | | |
| | & Loops | Type | Slack| (cycles)| (ns) | Latency | Interval| Count | Pipelined| BRAM | DSP | FF | LUT | URAM| | |
| +---------------------------------------------------------+------+------+---------+-----------+----------+---------+-------+----------+----------+---------+-----------+-----------+-----+ | |
| |+ real_matmul | -| 0.00| 3310043| 3.310e+07| -| 3310044| -| no| 82 (29%)| 6 (2%)| 2026 (1%)| 2923 (5%)| -| | |
| | + real_matmul_Pipeline_MAT_A_ROWS_MAT_A_COLS | -| 0.00| 15004| 1.50 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /////////////////////////////////////////////////////////////////////////////// | |
| // Author: <> | |
| // Course: ECE8893 - Parallel Programming for FPGAs | |
| // Filename: real_matmul.cpp | |
| // Description: Perform matrix multiplication with real values | |
| // | |
| // Note: You are free to modify this code to optimize your design. | |
| /////////////////////////////////////////////////////////////////////////////// | |
| #include "real.h" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "input_model": { | |
| "type": "PyTorchModel", | |
| "config": { | |
| "hf_config": { | |
| "model_name": "model-cache/microsoft/phi-1_5", | |
| "task": "text-generation", | |
| "model_loading_args": { | |
| "trust_remote_code": true | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import csv | |
| import json | |
| from transformers import AutoTokenizer | |
| tokenizer = AutoTokenizer.from_pretrained('microsoft/phi-1_5') | |
| prompt_str = '### Wikipedia comment: {text}\n### Classifications:\n{classifications}' | |
| if __name__ == '__main__': | |
| # JSONL format | |
| output = [] |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.