Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
MRI TRDP
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Formanek Balázs István
MRI TRDP
Commits
e54dabf9
Commit
e54dabf9
authored
7 months ago
by
Formanek Balázs István
Browse files
Options
Downloads
Patches
Plain Diff
time measurement locally with autocast - cuda not available
parent
d4f39516
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
local_cpu_time_measurement_log.txt
+378
-0
378 additions, 0 deletions
local_cpu_time_measurement_log.txt
time_measure.py
+3
-2
3 additions, 2 deletions
time_measure.py
with
381 additions
and
2 deletions
local_cpu_time_measurement_log.txt
+
378
−
0
View file @
e54dabf9
...
@@ -349,4 +349,382 @@ Prediction time for one image: 8.06 ms
...
@@ -349,4 +349,382 @@ Prediction time for one image: 8.06 ms
Compete inference time for one image: 255.45 ms
Compete inference time for one image: 255.45 ms
DEVICE: cuda
DEVICE: cuda
cuda is not available
cuda is not available
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
AUTOCAST -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
(.venv) bformanek@falcon:~/TRDP_II$ python time_measure.py
MEASUREMENT - 1
Selected image path: /net/travail/bformanek/MRI_dataset/test/T1wCE/52956_3D_T1_FSPGR_Gado_7_3304.3556_1_243.png
Copied to local image path: /net/cremi/bformanek/TRDP_II/local_images/52956_3D_T1_FSPGR_Gado_7_3304.3556_1_243.png
MODEL:
transfer_checkpoints_mobilenetv3_small_100.lamb_in1k_avp_028.pkl
DEVICE: cpu
Inference time masurement using cpu
Image loaded: 4.27 ms
Model loaded: 4199.28 ms
Prediction time for one image: 110.62 ms
Compete inference time for one image: 4314.20 ms
DEVICE: cuda
cuda is not available
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
MODEL:
transfer_checkpoints_efficientnet_b0_adam_amp_criterion_balanced_avp_026.pkl
DEVICE: cpu
Inference time masurement using cpu
Image loaded: 2.16 ms
Model loaded: 21.11 ms
Prediction time for one image: 259.39 ms
Compete inference time for one image: 282.68 ms
DEVICE: cuda
cuda is not available
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
MODEL:
transfer_checkpoints_resnet18.fb_ssl_yfcc100m_ft_in1k_avp_022.pkl
DEVICE: cpu
Inference time masurement using cpu
Image loaded: 1.37 ms
Model loaded: 11.52 ms
Prediction time for one image: 790.65 ms
Compete inference time for one image: 803.57 ms
DEVICE: cuda
cuda is not available
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
MODEL:
transfer_checkpoints_mobilenetv4_conv_large.e500_r256_in1k_avp_004.pkl
DEVICE: cpu
Inference time masurement using cpu
Image loaded: 1.43 ms
Model loaded: 40.42 ms
Prediction time for one image: 1259.67 ms
Compete inference time for one image: 1301.54 ms
DEVICE: cuda
cuda is not available
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
MODEL:
transfer_checkpoints_resnet18_adam_amp_criterion_balanced_avp_025.pkl
DEVICE: cpu
Inference time masurement using cpu
Image loaded: 1.48 ms
Model loaded: 24.82 ms
Prediction time for one image: 759.29 ms
Compete inference time for one image: 785.60 ms
DEVICE: cuda
cuda is not available
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
MODEL:
transfer_checkpoints_resnet18_augmentation2_avp_019.pkl
DEVICE: cpu
Inference time masurement using cpu
Image loaded: 1.28 ms
Model loaded: 10.59 ms
Prediction time for one image: 756.31 ms
Compete inference time for one image: 768.21 ms
DEVICE: cuda
cuda is not available
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
MODEL:
transfer_checkpoints_resnet18_augmentation4_avp_024.pkl
DEVICE: cpu
Inference time masurement using cpu
Image loaded: 1.36 ms
Model loaded: 10.72 ms
Prediction time for one image: 761.23 ms
Compete inference time for one image: 773.34 ms
DEVICE: cuda
cuda is not available
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
MODEL:
transfer_checkpoints_resnet18.a2_in1k_avp_012.pkl
DEVICE: cpu
Inference time masurement using cpu
Image loaded: 1.39 ms
Model loaded: 10.92 ms
Prediction time for one image: 758.33 ms
Compete inference time for one image: 770.66 ms
DEVICE: cuda
cuda is not available
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
MODEL:
transfer_checkpoints_resnet50_adam_amp_criterion_balanced_avp_018.pkl
DEVICE: cpu
Inference time masurement using cpu
Image loaded: 1.35 ms
Model loaded: 27.15 ms
Prediction time for one image: 1755.68 ms
Compete inference time for one image: 1784.20 ms
DEVICE: cuda
cuda is not available
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
MODEL:
transfer_checkpoints_resnet18_augmentation1_avp_021.pkl
DEVICE: cpu
Inference time masurement using cpu
Image loaded: 1.57 ms
Model loaded: 251.80 ms
Prediction time for one image: 752.50 ms
Compete inference time for one image: 1005.90 ms
DEVICE: cuda
cuda is not available
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
MODEL:
transfer_checkpoints_resnet18_augmentation3_avp_003.pkl
DEVICE: cpu
Inference time masurement using cpu
Image loaded: 1.50 ms
Model loaded: 235.72 ms
Prediction time for one image: 758.73 ms
Compete inference time for one image: 995.98 ms
DEVICE: cuda
cuda is not available
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
MEASUREMENT - 2
Selected image path: /net/travail/bformanek/MRI_dataset/test/T1wCE/206409_Ax_3D_T1_BRAVO_3_2198.3138_2_110.png
Copied to local image path: /net/cremi/bformanek/TRDP_II/local_images/206409_Ax_3D_T1_BRAVO_3_2198.3138_2_110.png
MODEL:
transfer_checkpoints_mobilenetv3_small_100.lamb_in1k_avp_028.pkl
DEVICE: cpu
Inference time masurement using cpu
Image loaded: 1.88 ms
Model loaded: 11.31 ms
Prediction time for one image: 39.13 ms
Compete inference time for one image: 52.34 ms
DEVICE: cuda
cuda is not available
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
MODEL:
transfer_checkpoints_efficientnet_b0_adam_amp_criterion_balanced_avp_026.pkl
DEVICE: cpu
Inference time masurement using cpu
Image loaded: 1.28 ms
Model loaded: 9.84 ms
Prediction time for one image: 257.37 ms
Compete inference time for one image: 268.51 ms
DEVICE: cuda
cuda is not available
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
MODEL:
transfer_checkpoints_resnet18.fb_ssl_yfcc100m_ft_in1k_avp_022.pkl
DEVICE: cpu
Inference time masurement using cpu
Image loaded: 1.43 ms
Model loaded: 11.66 ms
Prediction time for one image: 763.84 ms
Compete inference time for one image: 776.96 ms
DEVICE: cuda
cuda is not available
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
MODEL:
transfer_checkpoints_mobilenetv4_conv_large.e500_r256_in1k_avp_004.pkl
DEVICE: cpu
Inference time masurement using cpu
Image loaded: 1.31 ms
Model loaded: 40.51 ms
Prediction time for one image: 1232.71 ms
Compete inference time for one image: 1274.56 ms
DEVICE: cuda
cuda is not available
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
MODEL:
transfer_checkpoints_resnet18_adam_amp_criterion_balanced_avp_025.pkl
DEVICE: cpu
Inference time masurement using cpu
Image loaded: 1.43 ms
Model loaded: 11.28 ms
Prediction time for one image: 767.15 ms
Compete inference time for one image: 779.88 ms
DEVICE: cuda
cuda is not available
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
MODEL:
transfer_checkpoints_resnet18_augmentation2_avp_019.pkl
DEVICE: cpu
Inference time masurement using cpu
Image loaded: 1.57 ms
Model loaded: 19.99 ms
Prediction time for one image: 762.84 ms
Compete inference time for one image: 784.42 ms
DEVICE: cuda
cuda is not available
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
MODEL:
transfer_checkpoints_resnet18_augmentation4_avp_024.pkl
DEVICE: cpu
Inference time masurement using cpu
Image loaded: 1.63 ms
Model loaded: 10.60 ms
Prediction time for one image: 760.14 ms
Compete inference time for one image: 772.39 ms
DEVICE: cuda
cuda is not available
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
MODEL:
transfer_checkpoints_resnet18.a2_in1k_avp_012.pkl
DEVICE: cpu
Inference time masurement using cpu
Image loaded: 1.30 ms
Model loaded: 29.00 ms
Prediction time for one image: 761.77 ms
Compete inference time for one image: 792.10 ms
DEVICE: cuda
cuda is not available
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
MODEL:
transfer_checkpoints_resnet50_adam_amp_criterion_balanced_avp_018.pkl
DEVICE: cpu
Inference time masurement using cpu
Image loaded: 1.38 ms
Model loaded: 27.51 ms
Prediction time for one image: 1740.18 ms
Compete inference time for one image: 1769.11 ms
DEVICE: cuda
cuda is not available
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
MODEL:
transfer_checkpoints_resnet18_augmentation1_avp_021.pkl
DEVICE: cpu
Inference time masurement using cpu
Image loaded: 1.36 ms
Model loaded: 11.00 ms
Prediction time for one image: 763.83 ms
Compete inference time for one image: 776.22 ms
DEVICE: cuda
cuda is not available
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
MODEL:
transfer_checkpoints_resnet18_augmentation3_avp_003.pkl
DEVICE: cpu
Inference time masurement using cpu
Image loaded: 1.57 ms
Model loaded: 17.03 ms
Prediction time for one image: 769.91 ms
Compete inference time for one image: 788.54 ms
DEVICE: cuda
cuda is not available
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
MEASUREMENT - 3
Selected image path: /net/travail/bformanek/MRI_dataset/test/FLAIR/ADNI_941_S_6575_MR_Sagittal_3D_FLAIR__br_raw_20180907105359840_92_S725112_I1045991_148.9936_1_121.png
Copied to local image path: /net/cremi/bformanek/TRDP_II/local_images/ADNI_941_S_6575_MR_Sagittal_3D_FLAIR__br_raw_20180907105359840_92_S725112_I1045991_148.9936_1_121.png
MODEL:
transfer_checkpoints_mobilenetv3_small_100.lamb_in1k_avp_028.pkl
DEVICE: cpu
Inference time masurement using cpu
Image loaded: 1.68 ms
Model loaded: 12.43 ms
Prediction time for one image: 61.61 ms
Compete inference time for one image: 75.74 ms
DEVICE: cuda
cuda is not available
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
MODEL:
transfer_checkpoints_efficientnet_b0_adam_amp_criterion_balanced_avp_026.pkl
DEVICE: cpu
Inference time masurement using cpu
Image loaded: 1.43 ms
Model loaded: 10.10 ms
Prediction time for one image: 252.84 ms
Compete inference time for one image: 264.39 ms
DEVICE: cuda
cuda is not available
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
MODEL:
transfer_checkpoints_resnet18.fb_ssl_yfcc100m_ft_in1k_avp_022.pkl
DEVICE: cpu
Inference time masurement using cpu
Image loaded: 2.02 ms
Model loaded: 12.19 ms
Prediction time for one image: 794.26 ms
Compete inference time for one image: 808.49 ms
DEVICE: cuda
cuda is not available
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
MODEL:
transfer_checkpoints_mobilenetv4_conv_large.e500_r256_in1k_avp_004.pkl
DEVICE: cpu
Inference time masurement using cpu
Image loaded: 1.59 ms
Model loaded: 115.56 ms
Prediction time for one image: 1209.87 ms
Compete inference time for one image: 1327.05 ms
DEVICE: cuda
cuda is not available
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
MODEL:
transfer_checkpoints_resnet18_adam_amp_criterion_balanced_avp_025.pkl
DEVICE: cpu
Inference time masurement using cpu
Image loaded: 1.44 ms
Model loaded: 8.18 ms
Prediction time for one image: 762.42 ms
Compete inference time for one image: 772.06 ms
DEVICE: cuda
cuda is not available
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
MODEL:
transfer_checkpoints_resnet18_augmentation2_avp_019.pkl
DEVICE: cpu
Inference time masurement using cpu
Image loaded: 5.80 ms
Model loaded: 18.08 ms
Prediction time for one image: 777.15 ms
Compete inference time for one image: 801.06 ms
DEVICE: cuda
cuda is not available
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
MODEL:
transfer_checkpoints_resnet18_augmentation4_avp_024.pkl
DEVICE: cpu
Inference time masurement using cpu
Image loaded: 6.50 ms
Model loaded: 15.12 ms
Prediction time for one image: 788.77 ms
Compete inference time for one image: 810.42 ms
DEVICE: cuda
cuda is not available
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
MODEL:
transfer_checkpoints_resnet18.a2_in1k_avp_012.pkl
DEVICE: cpu
Inference time masurement using cpu
Image loaded: 1.38 ms
Model loaded: 10.74 ms
Prediction time for one image: 769.79 ms
Compete inference time for one image: 781.94 ms
DEVICE: cuda
cuda is not available
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
MODEL:
transfer_checkpoints_resnet50_adam_amp_criterion_balanced_avp_018.pkl
DEVICE: cpu
Inference time masurement using cpu
Image loaded: 1.20 ms
Model loaded: 27.04 ms
Prediction time for one image: 1769.12 ms
Compete inference time for one image: 1797.40 ms
DEVICE: cuda
cuda is not available
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
MODEL:
transfer_checkpoints_resnet18_augmentation1_avp_021.pkl
DEVICE: cpu
Inference time masurement using cpu
Image loaded: 1.59 ms
Model loaded: 24.16 ms
Prediction time for one image: 756.25 ms
Compete inference time for one image: 782.01 ms
DEVICE: cuda
cuda is not available
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
MODEL:
transfer_checkpoints_resnet18_augmentation3_avp_003.pkl
DEVICE: cpu
Inference time masurement using cpu
Image loaded: 1.43 ms
Model loaded: 35.16 ms
Prediction time for one image: 765.55 ms
Compete inference time for one image: 802.17 ms
DEVICE: cuda
cuda is not available
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
\ No newline at end of file
This diff is collapsed.
Click to expand it.
time_measure.py
+
3
−
2
View file @
e54dabf9
...
@@ -77,8 +77,9 @@ def inference_time_measurement(model_path, image_path, transform, device = 'cuda
...
@@ -77,8 +77,9 @@ def inference_time_measurement(model_path, image_path, transform, device = 'cuda
image
=
image
.
to
(
device
)
image
=
image
.
to
(
device
)
prediction_time_start
=
time
.
time
()
prediction_time_start
=
time
.
time
()
with
torch
.
no_grad
():
with
torch
.
no_grad
():
# Perform prediction
with
torch
.
autocast
(
device_type
=
device
,
dtype
=
torch
.
bfloat16
):
output
=
model
(
image
)
# Perform prediction
output
=
model
(
image
)
end_time
=
time
.
time
()
end_time
=
time
.
time
()
prediction_time
=
(
end_time
-
prediction_time_start
)
*
1000
prediction_time
=
(
end_time
-
prediction_time_start
)
*
1000
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment