99爱在线视频这里只有精品_窝窝午夜看片成人精品_日韩精品久久久毛片一区二区_亚洲一区二区久久

合肥生活安徽新聞合肥交通合肥房產生活服務合肥教育合肥招聘合肥旅游文化藝術合肥美食合肥地圖合肥社保合肥醫(yī)院企業(yè)服務合肥法律

代做Computer Architecture、代寫Gem5 編程

時間:2024-06-08  來源:合肥網hfw.cc  作者:hfw.cc 我要糾錯



Computer Architecture
2024 Spring
Final Project Part 2Overview
Tutorial
● Gem5 Introduction
● Environment Setup
Projects
● Part 1 (5%)
○ Write C++ program to analyze the specification of L1 data cache.
● Part 2 (5%)
○ Given the hardware specifications, try to get the best performance for more 
complicated program.
2Project 2
3In this project, we will use a two-level cache 
computer system. Your task is to write a 
ViT(Vision Transformer) in C++ and optimize it. 
You can see more details of the system 
specification on the next page.
Description
4System Specifications
● ISA: X86
● CPU: TimingSimpleCPU (no pipeline, CPU stalls on every memory request)
● Caches
* L1 I cache and L1 D cache connect to the same L2 cache
● Memory size: 8192MB
5
I cache 
size
I cache 
associativity
 D cache 
size
D cache 
associativity
Policy Block size
L1 cache 16KB 8 16KB 4 LRU **B
L2 cache – – 1MB 16 LRU **BViT(Vision Transformer) – Transformer Overview
6
● A basic transformer block consists of 
○ Layer Normalization
○ MultiHead Self-Attention (MHSA) 
○ Feed Forward Network (FFN)
○ Residual connection (Add)
● You only need to focus on how to 
implement the function in the red box
● If you only want to complete the project 
instead of understanding the full 
algorithm about ViT, you can skip the 
section masked as redViT(Vision Transformer) – Image Pre-processing
7
● Normalize, resize to (300,300,3) and center crop to (224,224,3)ViT(Vision Transformer) – Patch Encoder
8
● In this project, we use Conv2D as Patch 
Encoder with kernel_size = (16,16), stride = 
(16,16) and output_channel = 768
● (224,224,3) -> (14,14, 16*16*3) -> (196, 768)ViT(Vision Transformer) – Class Token
9
● Now we have 196 tokens and each 
token has 768 features
● In order to record global information, we 
need concatenate one learnable class 
token with 196 tokens
● (196,768) -> (197,768)ViT(Vision Transformer) – Position Embedding
10
● Add the learnable position information 
on the patch embedding
● (197,768) + 
position_embedding(197,768) -> 
(197,768)ViT(Vision Transformer) – Layer Normalization
11
T
# of tokens
C
embedded dimension
● Normalize each token
● You need to normalize with the formulaAttention
ViT(Vision Transformer) – MultiHead Self Attention (1)
12
● Wk
, Wq
, Wv 
∈ RC✕C
● b
q
 , bk
, bv
∈ RC
● W

∈ RC✕C
 
● b
o
 ∈ RC
Input
Linear
Projection
X Attention
split 
into 
heads
merge 
heads
Output
Linear
Projection
Y
Wk
, Wq
, Wv W

b
q
 , bk
, bv b
o
 ViT(Vision Transformer) – MultiHead Self Attention (2)
13
T
# of tokens
C
embedded dimension
● Get Q, K, V ∈ RT✕(NH*H) after input linear projection
● Split Q, K, V into Q1
, Q2
, Q3
,..., QNH K1
, K2
, K3
,..., KNH V1
, V2
, V3
,..., VNH 
∈ RT✕H
H
hidden dimension
Linear Projection and split into heads
Linear Projection
Q = XWq
T
 + b
q
K = XWk
T
 + bk
V = XW
v
T
 + b
v
NH
# of head C = H * NHViT(Vision Transformer) – MultiHead Self Attention (2)
14
● For each head i, compute Si
 = QiKi
T
/square_root(H) ∈ RT✕T
● Pi = Softmax(Si
 ) ∈ RT✕T
, Softmax is a row-wise function
● Oi = Pi Vi ∈ RT✕H
Matrix
Multiplication
and scale
Qi
Ki
Softmax
Matrix
Multiplication Vi
Oi
SoftmaxViT(Vision Transformer) – MultiHead Self Attention (3)
15
T
# of tokens
C
embedded dimension
● Oi ∈ RT✕H
, O = [O1
, O2
,...,O2
 ]
H
hidden dimension
merge heads and Linear Projection
Linear Projection
output = OWo
T
 + b
o
NH
# of headViT(Vision Transformer) – Feed Forward Network
16
● Get Q, K, V ∈ RT✕(h*H) after input linear projection
● Split Q, K, V into Q1
, Q2
, Q3
,..., Qh
 K1
, K2
, K3
,..., Kh V1
, V2
, V3
,..., Vh ∈ RT✕H
T
# of tokens
C
embedded dimension
Input
Linear
Projection
T
# of tokens
OC
hidden dimension
GeLU
output
Linear
ProjectionViT(Vision Transformer) – GeLU
17ViT(Vision Transformer) – Classifier
18
● Contains a Linear layer to transform 768 features to 200 class
○ (197, 768) -> (197, 200)
● Only refer to the first token (class token)
○ (197, 200) -> (1, 200)ViT(Vision Transformer) – Work Flow
19
Pre-pocessing
Embedder
Transformer x12
Classifier
m5_dump_init
Load_weight
m5_dump_stat
Argmax
layernorm
MHSA
layernorm
FFN
matmul
attention
matmul
matmul
layernorm
matmul
Black footed Albatross
+
+
gelu
matmul
gelu
$ make gelu_tb
$ make matmul_tb
$ make layernorm_tb
$ make MHSA_tb
$ make feedforward_tb
 $ make transformer_tb
$ run_all.sh
layernorm
layernorm
MHSA
residualViT(Vision Transformer) – Shape of array
20
layernorm token 1 token 2 …… token T
C
input/output [T*C]
MHSA input/output/o [T*C]
MHSA qkv [T*3*C] q token 1
C
k token 1 v token 1 …… q token T k token T v token T
feedforward input/output [T*C]
feedforward gelu [T*OC] token 1
OC
token 2 …… token TCommon problem
21
● Segmentation fault
○ ensure that you are not accessing a nonexistent memory address
○ Enter the command $ulimit -s unlimited All you have to do is
22
● Download TA’s Gem5 image
○ docker pull yenzu/ca_final_part2:2024
● Write C++ with understanding the algorithm in ./layer folder
○ make clean
○ make <layer>_tb
○ ./<layer>_tbAll you have to do is
23
● Ensure the ViT will successfully classify the bird
○ python3 embedder.py --image_path images/Black_Footed_Albatross_0001_796111.jpg 
--embedder_path weights/embedder.pth --output_path embedded_image.bin
○ g++ -static main.cpp layer/*.cpp -o process
○ ./process
○ python3 run_model.py --input_path result.bin --output_path torch_pred.bin --model_path 
weights/model.pth
○ python3 classifier.py --prediction_path torch_pred.bin --classifier_path 
weights/classifier.pth
○ After running the above commands, you will get the following top5 prediction.
● Evaluate the performance of part of ViT, that is layernorm+MHSA+residual
○ Need about 3.5 hours to finish the simulation
○ Check stat.txtGrading Policy
24
● (50%) Verification
○ (10%) matmul_tb
○ (10%) layernorm_tb
○ (10%) gelu_tb
○ (10%) MHSA_tb
○ (10%) transformer_tb
● (50%) Performance
○ max(sigmoid((27.74 - student latency)/student latency))*70, 50)
● You will get 0 performance point if your design is not verified.Submission
● Please submit code on E3 before 23:59 on June 20, 2024.
● Late submission is not allowed.
● Plagiarism is forbidden, otherwise you will get 0 point!!!
25
● Format
○ Code: please put your code in a folder 
named FP2_team<ID>_code and compress 
it into a zip file.
2
2
2FP2_team<ID>_code folder 
26
● You should attach the following documents
○ matmul.cpp
○ layernorm.cpp
○ gelu.cpp
○ attention.cpp
○ residual.cpp

請加QQ:99515681  郵箱:99515681@qq.com   WX:codinghelp



















 

掃一掃在手機打開當前頁
  • 上一篇:代做QBUS3600、代寫Python設計程序
  • 下一篇:哪些人可以辦理菲律賓團簽呢(跟團簽的材料)
  • 無相關信息
    合肥生活資訊

    合肥圖文信息
    2025年10月份更新拼多多改銷助手小象助手多多出評軟件
    2025年10月份更新拼多多改銷助手小象助手多
    有限元分析 CAE仿真分析服務-企業(yè)/產品研發(fā)/客戶要求/設計優(yōu)化
    有限元分析 CAE仿真分析服務-企業(yè)/產品研發(fā)
    急尋熱仿真分析?代做熱仿真服務+熱設計優(yōu)化
    急尋熱仿真分析?代做熱仿真服務+熱設計優(yōu)化
    出評 開團工具
    出評 開團工具
    挖掘機濾芯提升發(fā)動機性能
    挖掘機濾芯提升發(fā)動機性能
    海信羅馬假日洗衣機亮相AWE  復古美學與現代科技完美結合
    海信羅馬假日洗衣機亮相AWE 復古美學與現代
    合肥機場巴士4號線
    合肥機場巴士4號線
    合肥機場巴士3號線
    合肥機場巴士3號線
  • 短信驗證碼 trae 豆包網頁版入口 目錄網 排行網

    關于我們 | 打賞支持 | 廣告服務 | 聯(lián)系我們 | 網站地圖 | 免責聲明 | 幫助中心 | 友情鏈接 |

    Copyright © 2025 hfw.cc Inc. All Rights Reserved. 合肥網 版權所有
    ICP備06013414號-3 公安備 42010502001045

    99爱在线视频这里只有精品_窝窝午夜看片成人精品_日韩精品久久久毛片一区二区_亚洲一区二区久久

          9000px;">

                国产电影精品久久禁18| 久久青草欧美一区二区三区| 337p亚洲精品色噜噜狠狠| 国产日韩av一区二区| 久久电影网站中文字幕| 一本一本久久a久久精品综合麻豆 一本一道波多野结衣一区二区 | 中文字幕不卡在线观看| 成人精品电影在线观看| 久久综合九色综合97婷婷女人| 亚洲va在线va天堂| 色综合久久久久久久| 亚洲精品日韩综合观看成人91| 国产精品小仙女| 欧美国产日韩亚洲一区| 久久综合九色欧美综合狠狠 | 国产一区二区在线视频| 精品91自产拍在线观看一区| 午夜精品福利一区二区三区蜜桃| 福利一区二区在线观看| 色噜噜狠狠一区二区三区果冻| 亚洲电影中文字幕在线观看| 中文字幕中文字幕中文字幕亚洲无线| 麻豆国产一区二区| 老司机一区二区| 日韩精品中文字幕一区 | 日韩三级中文字幕| 免费视频最近日韩| 日韩一区二区电影| 国产成人精品免费视频网站| 中文字幕精品一区二区精品绿巨人| 国产毛片精品视频| 亚洲色图制服丝袜| 成人免费视频app| 亚洲国产日韩av| 首页国产欧美久久| 欧美高清激情brazzers| 蜜臀a∨国产成人精品| 日韩欧美在线网站| 国产成人欧美日韩在线电影| 国产成人在线观看| 99免费精品视频| 国产视频亚洲色图| 国产精品久久久久影院老司 | 国产伦精品一区二区三区免费| 久久美女艺术照精彩视频福利播放| 喷白浆一区二区| 久久久亚洲综合| 久久国产福利国产秒拍| 欧美国产成人精品| 欧美性大战久久久久久久| 另类人妖一区二区av| 国产精品免费丝袜| 欧美日韩国产一二三| 成人一区二区三区视频在线观看| 亚洲男人的天堂在线观看| 在线电影一区二区三区| 91在线观看高清| 免费成人性网站| 日韩一区二区在线播放| av在线综合网| 日韩国产一二三区| 日本韩国欧美一区二区三区| 日本不卡一区二区| 国产日产欧美一区二区视频| 91亚洲精品久久久蜜桃网站| 日本美女视频一区二区| 国产婷婷精品av在线| 日韩一区二区三区视频| 99久久99久久久精品齐齐| 日韩精品午夜视频| 亚洲午夜视频在线| 国产视频一区不卡| 69p69国产精品| 欧美三级日韩三级| 成人免费看黄yyy456| 日本系列欧美系列| 亚洲成人黄色小说| 国产精品久久久久国产精品日日| 99视频一区二区三区| 岛国一区二区三区| 久久超级碰视频| 亚洲激情校园春色| 中文字幕在线播放不卡一区| 欧美一区二区免费视频| 欧美私人免费视频| 成人99免费视频| 国产精品99久久久久久似苏梦涵| 精品一区二区三区在线观看国产| 亚洲最大成人综合| 国产精品理伦片| 国产精品久久夜| 国产欧美va欧美不卡在线 | 国模大尺度一区二区三区| 亚洲精品水蜜桃| 国产精品亲子乱子伦xxxx裸| 国产精品亲子乱子伦xxxx裸| 久久综合国产精品| 日本精品视频一区二区三区| 日本韩国欧美一区| 东方aⅴ免费观看久久av| 成人黄色一级视频| 成人免费视频一区| 国产在线看一区| 美腿丝袜亚洲一区| 国产精品福利一区| 久久久久99精品一区| 在线影院国内精品| 欧美日韩视频不卡| 精品视频一区 二区 三区| 97久久超碰国产精品电影| 成人中文字幕电影| 国产又黄又大久久| 成人av综合在线| 波多野结衣在线aⅴ中文字幕不卡| 亚洲精品视频在线看| 亚洲伦在线观看| 一区二区三区小说| 蜜桃视频在线观看一区| 久久福利资源站| 国产成人午夜精品影院观看视频 | 国产成人免费视频网站| 成人免费视频caoporn| 91在线精品一区二区| 91亚洲精品久久久蜜桃| 欧美精品免费视频| 欧美日韩一级二级三级| 欧美精品日韩一区| 国产午夜精品一区二区| 久久精品欧美日韩| 国产精品婷婷午夜在线观看| 亚洲图片激情小说| 亚洲高清一区二区三区| 日av在线不卡| 国产盗摄精品一区二区三区在线 | 日本久久一区二区| 99久久久国产精品免费蜜臀| 91精品国产综合久久福利软件 | 日韩精品一区二区在线| 日本一区二区三区四区在线视频| 亚洲天堂网中文字| 丝袜美腿高跟呻吟高潮一区| 国产成人福利片| 欧洲视频一区二区| 国产日韩欧美一区二区三区乱码 | 91精品午夜视频| 亚洲国产精品av| 一区二区三区日韩在线观看| 日韩不卡在线观看日韩不卡视频| 不卡的av网站| 欧美一区二区视频网站| 99国产一区二区三精品乱码| 欧美日韩在线播放一区| 欧美色图一区二区三区| 欧美久久免费观看| 国产三级三级三级精品8ⅰ区| 一区二区免费看| 精品在线观看视频| 91碰在线视频| 精品成人私密视频| 亚洲激情欧美激情| 99精品视频中文字幕| 日韩美女主播在线视频一区二区三区 | 日韩一区二区三区精品视频| 毛片一区二区三区| 成人晚上爱看视频| 久久久99久久| 99这里只有久久精品视频| 奇米综合一区二区三区精品视频| 粉嫩嫩av羞羞动漫久久久| 91精品国产91久久久久久最新毛片| 亚洲免费观看高清完整版在线观看熊 | 日韩av中文在线观看| 51久久夜色精品国产麻豆| 天堂一区二区在线| 91麻豆精品国产91久久久使用方法 | 一本久道中文字幕精品亚洲嫩| 久久婷婷久久一区二区三区| 国产综合久久久久影院| 国产精品国产三级国产专播品爱网| 国产精品夜夜爽| 亚洲精品国产精品乱码不99 | 日韩综合小视频| 国产精品超碰97尤物18| 久久免费午夜影院| 日韩一区二区精品葵司在线 | 国产成人啪免费观看软件| 精品一区二区免费在线观看| 亚洲一区二区三区中文字幕 | 色综合中文字幕| 久色婷婷小香蕉久久| 奇米一区二区三区av| 一级中文字幕一区二区| 136国产福利精品导航| 中文一区一区三区高中清不卡| 欧美精品v国产精品v日韩精品| 91久久精品一区二区| 99久久精品免费精品国产| 9色porny自拍视频一区二区| 91影院在线免费观看| 日韩无一区二区|