- 获取PID进程的内存信息 pmap -x ${pid} | sed 's/[//;s/]//' | grep rw | awk '{total[$7]+=$2}END{for(v in total){print total[v],v}}' | sort -n
- 查看进程内存 cat /proc/${pid}/status
- 系统内存信息 cat /proc/meminfo
- ffmpeg -i test.mp4 -vcodec h264 -bf 0 -g 25 -r 10 -s 1280*720 -an -f h264 test1.264 //-bf B帧数目控制,-g 关键帧间隔控制, -s 分辨率控制 -an关闭音频,-r 指定帧率
- gcc编译器预定义宏 gcc -dM -E -x c /dev/null
- 查看程序编译器版本 objdump -s --section=.comment your_program
- 写硬盘速度 time dd if=/dev/zero of=/tmp/test bs=8k count=1000000
- 读硬盘速度 time dd if=/tmp/test of=/dev/null bs=8k
- 读写ddr速度 -n 10表示运行10次,256表示测试所用的内存大小,单位为MB
apt-get install mbw
mbw -q -n 10 256 - 新建用户及用户管理
This file contains 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
#兼容新旧gcc版本,添加宏定义 | |
if(CONAN_LIBCXX STREQUAL "libstdc++11") | |
add_definitions(-D_GLIBCXX_USE_CXX11_ABI=1) | |
elseif(CONAN_LIBCXX STREQUAL "libstdc++") | |
add_definitions(-D_GLIBCXX_USE_CXX11_ABI=0)#gcc版本高于5时需要,才能链接opencv库 | |
endif() | |
#添加编译选项 | |
add_compile_options(-fPIC) |
在设计轻量级网络时,FLOPs和模型参数是主要考虑因素,但是减少模型大小和FLOPs不等同于减少推理时间和降低能耗。比如ShuffleNetv2与MobileNetv2在相同的FLOPs下,前者在GPU上速度更快。所以除了FLOPs和模型大小外,还需要考虑其他因素对能耗和模型推理速度的影响。这里考虑两个重要的因素:内存访问成本(Memory Access Cost,MAC)和GPU计算效率。
python常用操作: sorted(query,key=lambda x:x[1]) 用于元组排序,数组序号用于指定元组第几个元素排序
索引方法 | latency time | mean average precision | 0.65 false alarm rate |
---|---|---|---|
FLAT | |||
IVF_FLAT | |||
IVF_SQ8 | |||
IVF_SQ8H | |||
IVF_PQ | |||
RNSG | |||
HNSW | |||
ANNOY |
https://blog.csdn.net/weixin_39718268/article/details/105021631
python -m torch.distributed.launch --nproc_per_node=NUM_GPUS main.py [--arg1 --arg2 ...]
# 1) 初始化
torch.distributed.init_process_group(backend="nccl")
# 2) 配置每个进程的gpu
local_rank = torch.distributed.get_rank()
print('local_rank:{}'.format(local_rank))
torch.cuda.set_device(local_rank)
TensorRT版本性能差异测试ResNet50.onnx
模型-耗时ms/张 | TRT7.1.3.4 | TRT5.1.5.0 | 版本性能提升 |
---|---|---|---|
ResNet50-b1-fp32-Nvidia2080Ti | 2.0444 | 2.3022 | 11.20% |
ResNet50-b4-fp32 | 0.6491 | 1.1063 | 41.32% |
ResNet50-b8-fp32 | 0.3533 | 0.8849 | 60.07% |
ResNet50-b16-fp32 | 0.2037 | 0.7502 | 72.85% |
ResNet50-b1-int8 | 0.72 |