TensorFlow基准测试在多个线程上被杀死

时间:2019-04-05 08:54:57

标签: linux tensorflow benchmarking

昨天,我正在使用TensorFlow的Conda版本(即TF v1.12)运行一些性能测试:

conda create -n tf_conda python=3.6.8 tensorflow
git clone -b cnn_tf_v1.12_compatible --single-branch https://github.com/tensorflow/benchmarks.git
cd benchmarks/scripts/tf_cnn_benchmarks/
conda activate tf_conda
python tf_cnn_benchmarks.py --device=cpu --model=resnet50 --data_format=NHWC --num_batches=10 --num_warmup_batches=1

今天,当我在Conda中安装TensorFlow时,最终得到的是v1.13:

conda create -n tf_conda python=3.6.8 tensorflow
git clone -b cnn_tf_v1.13_compatible --single-branch https://github.com/tensorflow/benchmarks.git
cd benchmarks/scripts/tf_cnn_benchmarks/
conda activate tf_conda
python tf_cnn_benchmarks.py --device=cpu --model=resnet50 --data_format=NHWC --num_batches=10 --num_warmup_batches=1

然而,基准测试却惨败:

2019-04-05 08:41:04.146441: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: SSE4.1 SSE4.2 AVX
2019-04-05 08:41:04.164798: I tensorflow/core/platform/profile_utils/cpu_utils.cc:94] CPU Frequency: 2599995000 Hz
2019-04-05 08:41:04.165499: I tensorflow/compiler/xla/service/service.cc:150] XLA service 0x563d6af00290 executing computations on platform Host. Devices:
2019-04-05 08:41:04.165542: I tensorflow/compiler/xla/service/service.cc:158]   StreamExecutor device (0): <undefined>, <undefined>
OMP: Info #212: KMP_AFFINITY: decoding x2APIC ids.
OMP: Info #213: KMP_AFFINITY: cpuid leaf 11 not supported - decoding legacy APIC ids.
OMP: Info #149: KMP_AFFINITY: Affinity capable, using global cpuid info
OMP: Info #154: KMP_AFFINITY: Initial OS proc set respected: 0-3
OMP: Info #156: KMP_AFFINITY: 4 available OS procs
OMP: Info #157: KMP_AFFINITY: Uniform topology
OMP: Info #159: KMP_AFFINITY: 4 packages x 1 cores/pkg x 1 threads/core (4 total cores)
OMP: Info #214: KMP_AFFINITY: OS proc to physical thread map:
OMP: Info #171: KMP_AFFINITY: OS proc 0 maps to package 0
OMP: Info #171: KMP_AFFINITY: OS proc 1 maps to package 1
OMP: Info #171: KMP_AFFINITY: OS proc 2 maps to package 2
OMP: Info #171: KMP_AFFINITY: OS proc 3 maps to package 3
OMP: Info #250: KMP_AFFINITY: pid 1539 tid 1539 thread 0 bound to OS proc set 0
2019-04-05 08:41:04.166391: I tensorflow/core/common_runtime/process_util.cc:71] Creating new thread pool with default inter op setting: 2. Tune using inter_op_parallelism_threads for best performance.
W0405 08:41:04.172703 140193590863680 deprecation.py:323] From /home/nsapay/anaconda3/envs/tf_conda/lib/python3.6/site-packages/tensorflow/python/framework/op_def_library.py:263: colocate_with (from tensorflow.python.framework.ops) is deprecated and will be removed in a future version.
Instructions for updating:
Colocations handled automatically by placer.
...
OMP: Info #250: KMP_AFFINITY: pid 1539 tid 1557 thread 1 bound to OS proc set 1
OMP: Info #250: KMP_AFFINITY: pid 1539 tid 1585 thread 3 bound to OS proc set 3
OMP: Info #250: KMP_AFFINITY: pid 1539 tid 1586 thread 4 bound to OS proc set 0
OMP: Info #250: KMP_AFFINITY: pid 1539 tid 1584 thread 2 bound to OS proc set 2
OMP: Info #250: KMP_AFFINITY: pid 1539 tid 1556 thread 5 bound to OS proc set 1
OMP: Info #250: KMP_AFFINITY: pid 1539 tid 1588 thread 7 bound to OS proc set 3
OMP: Info #250: KMP_AFFINITY: pid 1539 tid 1587 thread 6 bound to OS proc set 2
OMP: Info #250: KMP_AFFINITY: pid 1539 tid 1589 thread 8 bound to OS proc set 0
Killed. 

我完全感到困惑……昨天和今天之间我没有更新系统。我正在使用4个(虚拟)内核(英特尔至强E3)和常规的CentOS 7发行版。

1 个答案:

答案 0 :(得分:0)

确实,我内存不足。内存监视来自另一个虚拟机(不方便同时使用多个计算机)。