relative_path
stringclasses
812 values
section
stringclasses
339 values
filename
stringlengths
2
61
text
stringlengths
6
1.76M
PyTorch/Classification/GPUNet/triton/runner/maintainer
maintainer
container
# Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import abc from typing import Any class Container(abc.ABC): def __init__(self, name: str): self.name = name self._container = None @abc.abstractmethod def start(self): """ Start container """ pass @abc.abstractmethod def stop(self): """ Stop container """ @abc.abstractmethod def run(self, command: str) -> Any: """ Run command inside container Args: command: command to execute Returns: Any """ pass
TensorFlow/Detection/SSD/models/research/slim/nets
nets
resnet_v2_test
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== """Tests for slim.nets.resnet_v2.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np import tensorflow as tf from nets import resnet_utils from nets import resnet_v2 slim = tf.contrib.slim def create_test_input(batch_size, height, width, channels): """Create test input tensor. Args: batch_size: The number of images per batch or `None` if unknown. height: The height of each image or `None` if unknown. width: The width of each image or `None` if unknown. channels: The number of channels per image or `None` if unknown. Returns: Either a placeholder `Tensor` of dimension [batch_size, height, width, channels] if any of the inputs are `None` or a constant `Tensor` with the mesh grid values along the spatial dimensions. """ if None in [batch_size, height, width, channels]: return tf.placeholder(tf.float32, (batch_size, height, width, channels)) else: return tf.to_float( np.tile( np.reshape( np.reshape(np.arange(height), [height, 1]) + np.reshape(np.arange(width), [1, width]), [1, height, width, 1]), [batch_size, 1, 1, channels])) class ResnetUtilsTest(tf.test.TestCase): def testSubsampleThreeByThree(self): x = tf.reshape(tf.to_float(tf.range(9)), [1, 3, 3, 1]) x = resnet_utils.subsample(x, 2) expected = tf.reshape(tf.constant([0, 2, 6, 8]), [1, 2, 2, 1]) with self.test_session(): self.assertAllClose(x.eval(), expected.eval()) def testSubsampleFourByFour(self): x = tf.reshape(tf.to_float(tf.range(16)), [1, 4, 4, 1]) x = resnet_utils.subsample(x, 2) expected = tf.reshape(tf.constant([0, 2, 8, 10]), [1, 2, 2, 1]) with self.test_session(): self.assertAllClose(x.eval(), expected.eval()) def testConv2DSameEven(self): n, n2 = 4, 2 # Input image. x = create_test_input(1, n, n, 1) # Convolution kernel. w = create_test_input(1, 3, 3, 1) w = tf.reshape(w, [3, 3, 1, 1]) tf.get_variable('Conv/weights', initializer=w) tf.get_variable('Conv/biases', initializer=tf.zeros([1])) tf.get_variable_scope().reuse_variables() y1 = slim.conv2d(x, 1, [3, 3], stride=1, scope='Conv') y1_expected = tf.to_float([[14, 28, 43, 26], [28, 48, 66, 37], [43, 66, 84, 46], [26, 37, 46, 22]]) y1_expected = tf.reshape(y1_expected, [1, n, n, 1]) y2 = resnet_utils.subsample(y1, 2) y2_expected = tf.to_float([[14, 43], [43, 84]]) y2_expected = tf.reshape(y2_expected, [1, n2, n2, 1]) y3 = resnet_utils.conv2d_same(x, 1, 3, stride=2, scope='Conv') y3_expected = y2_expected y4 = slim.conv2d(x, 1, [3, 3], stride=2, scope='Conv') y4_expected = tf.to_float([[48, 37], [37, 22]]) y4_expected = tf.reshape(y4_expected, [1, n2, n2, 1]) with self.test_session() as sess: sess.run(tf.global_variables_initializer()) self.assertAllClose(y1.eval(), y1_expected.eval()) self.assertAllClose(y2.eval(), y2_expected.eval()) self.assertAllClose(y3.eval(), y3_expected.eval()) self.assertAllClose(y4.eval(), y4_expected.eval()) def testConv2DSameOdd(self): n, n2 = 5, 3 # Input image. x = create_test_input(1, n, n, 1) # Convolution kernel. w = create_test_input(1, 3, 3, 1) w = tf.reshape(w, [3, 3, 1, 1]) tf.get_variable('Conv/weights', initializer=w) tf.get_variable('Conv/biases', initializer=tf.zeros([1])) tf.get_variable_scope().reuse_variables() y1 = slim.conv2d(x, 1, [3, 3], stride=1, scope='Conv') y1_expected = tf.to_float([[14, 28, 43, 58, 34], [28, 48, 66, 84, 46], [43, 66, 84, 102, 55], [58, 84, 102, 120, 64], [34, 46, 55, 64, 30]]) y1_expected = tf.reshape(y1_expected, [1, n, n, 1]) y2 = resnet_utils.subsample(y1, 2) y2_expected = tf.to_float([[14, 43, 34], [43, 84, 55], [34, 55, 30]]) y2_expected = tf.reshape(y2_expected, [1, n2, n2, 1]) y3 = resnet_utils.conv2d_same(x, 1, 3, stride=2, scope='Conv') y3_expected = y2_expected y4 = slim.conv2d(x, 1, [3, 3], stride=2, scope='Conv') y4_expected = y2_expected with self.test_session() as sess: sess.run(tf.global_variables_initializer()) self.assertAllClose(y1.eval(), y1_expected.eval()) self.assertAllClose(y2.eval(), y2_expected.eval()) self.assertAllClose(y3.eval(), y3_expected.eval()) self.assertAllClose(y4.eval(), y4_expected.eval()) def _resnet_plain(self, inputs, blocks, output_stride=None, scope=None): """A plain ResNet without extra layers before or after the ResNet blocks.""" with tf.variable_scope(scope, values=[inputs]): with slim.arg_scope([slim.conv2d], outputs_collections='end_points'): net = resnet_utils.stack_blocks_dense(inputs, blocks, output_stride) end_points = slim.utils.convert_collection_to_dict('end_points') return net, end_points def testEndPointsV2(self): """Test the end points of a tiny v2 bottleneck network.""" blocks = [ resnet_v2.resnet_v2_block( 'block1', base_depth=1, num_units=2, stride=2), resnet_v2.resnet_v2_block( 'block2', base_depth=2, num_units=2, stride=1), ] inputs = create_test_input(2, 32, 16, 3) with slim.arg_scope(resnet_utils.resnet_arg_scope()): _, end_points = self._resnet_plain(inputs, blocks, scope='tiny') expected = [ 'tiny/block1/unit_1/bottleneck_v2/shortcut', 'tiny/block1/unit_1/bottleneck_v2/conv1', 'tiny/block1/unit_1/bottleneck_v2/conv2', 'tiny/block1/unit_1/bottleneck_v2/conv3', 'tiny/block1/unit_2/bottleneck_v2/conv1', 'tiny/block1/unit_2/bottleneck_v2/conv2', 'tiny/block1/unit_2/bottleneck_v2/conv3', 'tiny/block2/unit_1/bottleneck_v2/shortcut', 'tiny/block2/unit_1/bottleneck_v2/conv1', 'tiny/block2/unit_1/bottleneck_v2/conv2', 'tiny/block2/unit_1/bottleneck_v2/conv3', 'tiny/block2/unit_2/bottleneck_v2/conv1', 'tiny/block2/unit_2/bottleneck_v2/conv2', 'tiny/block2/unit_2/bottleneck_v2/conv3'] self.assertItemsEqual(expected, end_points.keys()) def _stack_blocks_nondense(self, net, blocks): """A simplified ResNet Block stacker without output stride control.""" for block in blocks: with tf.variable_scope(block.scope, 'block', [net]): for i, unit in enumerate(block.args): with tf.variable_scope('unit_%d' % (i + 1), values=[net]): net = block.unit_fn(net, rate=1, **unit) return net def testAtrousValuesBottleneck(self): """Verify the values of dense feature extraction by atrous convolution. Make sure that dense feature extraction by stack_blocks_dense() followed by subsampling gives identical results to feature extraction at the nominal network output stride using the simple self._stack_blocks_nondense() above. """ block = resnet_v2.resnet_v2_block blocks = [ block('block1', base_depth=1, num_units=2, stride=2), block('block2', base_depth=2, num_units=2, stride=2), block('block3', base_depth=4, num_units=2, stride=2), block('block4', base_depth=8, num_units=2, stride=1), ] nominal_stride = 8 # Test both odd and even input dimensions. height = 30 width = 31 with slim.arg_scope(resnet_utils.resnet_arg_scope()): with slim.arg_scope([slim.batch_norm], is_training=False): for output_stride in [1, 2, 4, 8, None]: with tf.Graph().as_default(): with self.test_session() as sess: tf.set_random_seed(0) inputs = create_test_input(1, height, width, 3) # Dense feature extraction followed by subsampling. output = resnet_utils.stack_blocks_dense(inputs, blocks, output_stride) if output_stride is None: factor = 1 else: factor = nominal_stride // output_stride output = resnet_utils.subsample(output, factor) # Make the two networks use the same weights. tf.get_variable_scope().reuse_variables() # Feature extraction at the nominal network rate. expected = self._stack_blocks_nondense(inputs, blocks) sess.run(tf.global_variables_initializer()) output, expected = sess.run([output, expected]) self.assertAllClose(output, expected, atol=1e-4, rtol=1e-4) class ResnetCompleteNetworkTest(tf.test.TestCase): """Tests with complete small ResNet v2 networks.""" def _resnet_small(self, inputs, num_classes=None, is_training=True, global_pool=True, output_stride=None, include_root_block=True, spatial_squeeze=True, reuse=None, scope='resnet_v2_small'): """A shallow and thin ResNet v2 for faster tests.""" block = resnet_v2.resnet_v2_block blocks = [ block('block1', base_depth=1, num_units=3, stride=2), block('block2', base_depth=2, num_units=3, stride=2), block('block3', base_depth=4, num_units=3, stride=2), block('block4', base_depth=8, num_units=2, stride=1), ] return resnet_v2.resnet_v2(inputs, blocks, num_classes, is_training=is_training, global_pool=global_pool, output_stride=output_stride, include_root_block=include_root_block, spatial_squeeze=spatial_squeeze, reuse=reuse, scope=scope) def testClassificationEndPoints(self): global_pool = True num_classes = 10 inputs = create_test_input(2, 224, 224, 3) with slim.arg_scope(resnet_utils.resnet_arg_scope()): logits, end_points = self._resnet_small(inputs, num_classes, global_pool=global_pool, spatial_squeeze=False, scope='resnet') self.assertTrue(logits.op.name.startswith('resnet/logits')) self.assertListEqual(logits.get_shape().as_list(), [2, 1, 1, num_classes]) self.assertTrue('predictions' in end_points) self.assertListEqual(end_points['predictions'].get_shape().as_list(), [2, 1, 1, num_classes]) self.assertTrue('global_pool' in end_points) self.assertListEqual(end_points['global_pool'].get_shape().as_list(), [2, 1, 1, 32]) def testEndpointNames(self): # Like ResnetUtilsTest.testEndPointsV2(), but for the public API. global_pool = True num_classes = 10 inputs = create_test_input(2, 224, 224, 3) with slim.arg_scope(resnet_utils.resnet_arg_scope()): _, end_points = self._resnet_small(inputs, num_classes, global_pool=global_pool, scope='resnet') expected = ['resnet/conv1'] for block in range(1, 5): for unit in range(1, 4 if block < 4 else 3): for conv in range(1, 4): expected.append('resnet/block%d/unit_%d/bottleneck_v2/conv%d' % (block, unit, conv)) expected.append('resnet/block%d/unit_%d/bottleneck_v2' % (block, unit)) expected.append('resnet/block%d/unit_1/bottleneck_v2/shortcut' % block) expected.append('resnet/block%d' % block) expected.extend(['global_pool', 'resnet/logits', 'resnet/spatial_squeeze', 'predictions']) self.assertItemsEqual(end_points.keys(), expected) def testClassificationShapes(self): global_pool = True num_classes = 10 inputs = create_test_input(2, 224, 224, 3) with slim.arg_scope(resnet_utils.resnet_arg_scope()): _, end_points = self._resnet_small(inputs, num_classes, global_pool=global_pool, scope='resnet') endpoint_to_shape = { 'resnet/block1': [2, 28, 28, 4], 'resnet/block2': [2, 14, 14, 8], 'resnet/block3': [2, 7, 7, 16], 'resnet/block4': [2, 7, 7, 32]} for endpoint in endpoint_to_shape: shape = endpoint_to_shape[endpoint] self.assertListEqual(end_points[endpoint].get_shape().as_list(), shape) def testFullyConvolutionalEndpointShapes(self): global_pool = False num_classes = 10 inputs = create_test_input(2, 321, 321, 3) with slim.arg_scope(resnet_utils.resnet_arg_scope()): _, end_points = self._resnet_small(inputs, num_classes, global_pool=global_pool, spatial_squeeze=False, scope='resnet') endpoint_to_shape = { 'resnet/block1': [2, 41, 41, 4], 'resnet/block2': [2, 21, 21, 8], 'resnet/block3': [2, 11, 11, 16], 'resnet/block4': [2, 11, 11, 32]} for endpoint in endpoint_to_shape: shape = endpoint_to_shape[endpoint] self.assertListEqual(end_points[endpoint].get_shape().as_list(), shape) def testRootlessFullyConvolutionalEndpointShapes(self): global_pool = False num_classes = 10 inputs = create_test_input(2, 128, 128, 3) with slim.arg_scope(resnet_utils.resnet_arg_scope()): _, end_points = self._resnet_small(inputs, num_classes, global_pool=global_pool, include_root_block=False, spatial_squeeze=False, scope='resnet') endpoint_to_shape = { 'resnet/block1': [2, 64, 64, 4], 'resnet/block2': [2, 32, 32, 8], 'resnet/block3': [2, 16, 16, 16], 'resnet/block4': [2, 16, 16, 32]} for endpoint in endpoint_to_shape: shape = endpoint_to_shape[endpoint] self.assertListEqual(end_points[endpoint].get_shape().as_list(), shape) def testAtrousFullyConvolutionalEndpointShapes(self): global_pool = False num_classes = 10 output_stride = 8 inputs = create_test_input(2, 321, 321, 3) with slim.arg_scope(resnet_utils.resnet_arg_scope()): _, end_points = self._resnet_small(inputs, num_classes, global_pool=global_pool, output_stride=output_stride, spatial_squeeze=False, scope='resnet') endpoint_to_shape = { 'resnet/block1': [2, 41, 41, 4], 'resnet/block2': [2, 41, 41, 8], 'resnet/block3': [2, 41, 41, 16], 'resnet/block4': [2, 41, 41, 32]} for endpoint in endpoint_to_shape: shape = endpoint_to_shape[endpoint] self.assertListEqual(end_points[endpoint].get_shape().as_list(), shape) def testAtrousFullyConvolutionalValues(self): """Verify dense feature extraction with atrous convolution.""" nominal_stride = 32 for output_stride in [4, 8, 16, 32, None]: with slim.arg_scope(resnet_utils.resnet_arg_scope()): with tf.Graph().as_default(): with self.test_session() as sess: tf.set_random_seed(0) inputs = create_test_input(2, 81, 81, 3) # Dense feature extraction followed by subsampling. output, _ = self._resnet_small(inputs, None, is_training=False, global_pool=False, output_stride=output_stride) if output_stride is None: factor = 1 else: factor = nominal_stride // output_stride output = resnet_utils.subsample(output, factor) # Make the two networks use the same weights. tf.get_variable_scope().reuse_variables() # Feature extraction at the nominal network rate. expected, _ = self._resnet_small(inputs, None, is_training=False, global_pool=False) sess.run(tf.global_variables_initializer()) self.assertAllClose(output.eval(), expected.eval(), atol=1e-4, rtol=1e-4) def testUnknownBatchSize(self): batch = 2 height, width = 65, 65 global_pool = True num_classes = 10 inputs = create_test_input(None, height, width, 3) with slim.arg_scope(resnet_utils.resnet_arg_scope()): logits, _ = self._resnet_small(inputs, num_classes, global_pool=global_pool, spatial_squeeze=False, scope='resnet') self.assertTrue(logits.op.name.startswith('resnet/logits')) self.assertListEqual(logits.get_shape().as_list(), [None, 1, 1, num_classes]) images = create_test_input(batch, height, width, 3) with self.test_session() as sess: sess.run(tf.global_variables_initializer()) output = sess.run(logits, {inputs: images.eval()}) self.assertEqual(output.shape, (batch, 1, 1, num_classes)) def testFullyConvolutionalUnknownHeightWidth(self): batch = 2 height, width = 65, 65 global_pool = False inputs = create_test_input(batch, None, None, 3) with slim.arg_scope(resnet_utils.resnet_arg_scope()): output, _ = self._resnet_small(inputs, None, global_pool=global_pool) self.assertListEqual(output.get_shape().as_list(), [batch, None, None, 32]) images = create_test_input(batch, height, width, 3) with self.test_session() as sess: sess.run(tf.global_variables_initializer()) output = sess.run(output, {inputs: images.eval()}) self.assertEqual(output.shape, (batch, 3, 3, 32)) def testAtrousFullyConvolutionalUnknownHeightWidth(self): batch = 2 height, width = 65, 65 global_pool = False output_stride = 8 inputs = create_test_input(batch, None, None, 3) with slim.arg_scope(resnet_utils.resnet_arg_scope()): output, _ = self._resnet_small(inputs, None, global_pool=global_pool, output_stride=output_stride) self.assertListEqual(output.get_shape().as_list(), [batch, None, None, 32]) images = create_test_input(batch, height, width, 3) with self.test_session() as sess: sess.run(tf.global_variables_initializer()) output = sess.run(output, {inputs: images.eval()}) self.assertEqual(output.shape, (batch, 9, 9, 32)) if __name__ == '__main__': tf.test.main()
PyTorch/SpeechRecognition/Jasper/scripts
scripts
inference
#!/bin/bash # Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. : ${DATA_DIR:=${1:-"/datasets/LibriSpeech"}} : ${MODEL_CONFIG:=${2:-"configs/jasper10x5dr_speedp-online_speca.yaml"}} : ${OUTPUT_DIR:=${3:-"/results"}} : ${CHECKPOINT:=${4:-"/checkpoints/jasper_fp16.pt"}} : ${DATASET:="test-other"} : ${LOG_FILE:=""} : ${CUDNN_BENCHMARK:=false} : ${MAX_DURATION:=""} : ${PAD_TO_MAX_DURATION:=false} : ${PAD_LEADING:=16} : ${NUM_GPUS:=1} : ${NUM_STEPS:=0} : ${NUM_WARMUP_STEPS:=0} : ${AMP:=false} : ${BATCH_SIZE:=64} : ${EMA:=true} : ${SEED:=0} : ${DALI_DEVICE:="gpu"} : ${CPU:=false} : ${LOGITS_FILE:=} : ${PREDICTION_FILE:="${OUTPUT_DIR}/${DATASET}.predictions"} mkdir -p "$OUTPUT_DIR" ARGS="--dataset_dir=$DATA_DIR" ARGS+=" --val_manifest=$DATA_DIR/librispeech-${DATASET}-wav.json" ARGS+=" --model_config=$MODEL_CONFIG" ARGS+=" --output_dir=$OUTPUT_DIR" ARGS+=" --batch_size=$BATCH_SIZE" ARGS+=" --seed=$SEED" ARGS+=" --dali_device=$DALI_DEVICE" ARGS+=" --steps $NUM_STEPS" ARGS+=" --warmup_steps $NUM_WARMUP_STEPS" ARGS+=" --pad_leading $PAD_LEADING" [ "$AMP" = true ] && ARGS+=" --amp" [ "$EMA" = true ] && ARGS+=" --ema" [ "$CUDNN_BENCHMARK" = true ] && ARGS+=" --cudnn_benchmark" [ -n "$CHECKPOINT" ] && ARGS+=" --ckpt=${CHECKPOINT}" [ -n "$LOG_FILE" ] && ARGS+=" --log_file $LOG_FILE" [ -n "$PREDICTION_FILE" ] && ARGS+=" --save_prediction $PREDICTION_FILE" [ -n "$LOGITS_FILE" ] && ARGS+=" --logits_save_to $LOGITS_FILE" [ "$CPU" == "true" ] && ARGS+=" --cpu" [ -n "$MAX_DURATION" ] && ARGS+=" --override_config input_val.audio_dataset.max_duration=$MAX_DURATION" \ ARGS+=" --override_config input_val.filterbank_features.max_duration=$MAX_DURATION" [ "$PAD_TO_MAX_DURATION" = true ] && ARGS+=" --override_config input_val.audio_dataset.pad_to_max_duration=True" \ ARGS+=" --override_config input_val.filterbank_features.pad_to_max_duration=True" python -m torch.distributed.launch --nproc_per_node=$NUM_GPUS inference.py $ARGS
PyTorch/Segmentation/MaskRCNN/pytorch/maskrcnn_benchmark/modeling/roi_heads/box_head
box_head
roi_box_feature_extractors
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. # Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved. import torch from torch import nn from torch.nn import functional as F from maskrcnn_benchmark.modeling import registry from maskrcnn_benchmark.modeling.backbone import resnet from maskrcnn_benchmark.modeling.poolers import Pooler from maskrcnn_benchmark.modeling.make_layers import group_norm from maskrcnn_benchmark.modeling.make_layers import make_fc @registry.ROI_BOX_FEATURE_EXTRACTORS.register("ResNet50Conv5ROIFeatureExtractor") class ResNet50Conv5ROIFeatureExtractor(nn.Module): def __init__(self, config): super(ResNet50Conv5ROIFeatureExtractor, self).__init__() resolution = config.MODEL.ROI_BOX_HEAD.POOLER_RESOLUTION scales = config.MODEL.ROI_BOX_HEAD.POOLER_SCALES sampling_ratio = config.MODEL.ROI_BOX_HEAD.POOLER_SAMPLING_RATIO pooler = Pooler( output_size=(resolution, resolution), scales=scales, sampling_ratio=sampling_ratio, ) stage = resnet.StageSpec(index=4, block_count=3, return_features=False) head = resnet.ResNetHead( block_module=config.MODEL.RESNETS.TRANS_FUNC, stages=(stage,), num_groups=config.MODEL.RESNETS.NUM_GROUPS, width_per_group=config.MODEL.RESNETS.WIDTH_PER_GROUP, stride_in_1x1=config.MODEL.RESNETS.STRIDE_IN_1X1, stride_init=None, res2_out_channels=config.MODEL.RESNETS.RES2_OUT_CHANNELS, dilation=config.MODEL.RESNETS.RES5_DILATION ) self.pooler = pooler self.head = head def forward(self, x, proposals): x = self.pooler(x, proposals) x = self.head(x) return x @registry.ROI_BOX_FEATURE_EXTRACTORS.register("FPN2MLPFeatureExtractor") class FPN2MLPFeatureExtractor(nn.Module): """ Heads for FPN for classification """ def __init__(self, cfg): super(FPN2MLPFeatureExtractor, self).__init__() resolution = cfg.MODEL.ROI_BOX_HEAD.POOLER_RESOLUTION scales = cfg.MODEL.ROI_BOX_HEAD.POOLER_SCALES sampling_ratio = cfg.MODEL.ROI_BOX_HEAD.POOLER_SAMPLING_RATIO pooler = Pooler( output_size=(resolution, resolution), scales=scales, sampling_ratio=sampling_ratio, is_nhwc=cfg.NHWC ) input_size = cfg.MODEL.BACKBONE.OUT_CHANNELS * resolution ** 2 representation_size = cfg.MODEL.ROI_BOX_HEAD.MLP_HEAD_DIM use_gn = cfg.MODEL.ROI_BOX_HEAD.USE_GN self.pooler = pooler self.fc6 = make_fc(input_size, representation_size, use_gn) self.fc7 = make_fc(representation_size, representation_size, use_gn) def forward(self, x, proposals): x = self.pooler(x, proposals) x = torch.flatten(x, start_dim=1) x = F.relu(self.fc6(x)) x = F.relu(self.fc7(x)) return x @registry.ROI_BOX_FEATURE_EXTRACTORS.register("FPNXconv1fcFeatureExtractor") class FPNXconv1fcFeatureExtractor(nn.Module): """ Heads for FPN for classification """ def __init__(self, cfg): super(FPNXconv1fcFeatureExtractor, self).__init__() resolution = cfg.MODEL.ROI_BOX_HEAD.POOLER_RESOLUTION scales = cfg.MODEL.ROI_BOX_HEAD.POOLER_SCALES sampling_ratio = cfg.MODEL.ROI_BOX_HEAD.POOLER_SAMPLING_RATIO pooler = Pooler( output_size=(resolution, resolution), scales=scales, sampling_ratio=sampling_ratio, ) self.pooler = pooler use_gn = cfg.MODEL.ROI_BOX_HEAD.USE_GN in_channels = cfg.MODEL.BACKBONE.OUT_CHANNELS conv_head_dim = cfg.MODEL.ROI_BOX_HEAD.CONV_HEAD_DIM num_stacked_convs = cfg.MODEL.ROI_BOX_HEAD.NUM_STACKED_CONVS dilation = cfg.MODEL.ROI_BOX_HEAD.DILATION xconvs = [] for ix in range(num_stacked_convs): xconvs.append( nn.Conv2d( in_channels, conv_head_dim, kernel_size=3, stride=1, padding=dilation, dilation=dilation, bias=False if use_gn else True ) ) in_channels = conv_head_dim if use_gn: xconvs.append(group_norm(in_channels)) xconvs.append(nn.ReLU(inplace=True)) self.add_module("xconvs", nn.Sequential(*xconvs)) for modules in [self.xconvs,]: for l in modules.modules(): if isinstance(l, nn.Conv2d): torch.nn.init.normal_(l.weight, std=0.01) if not use_gn: torch.nn.init.constant_(l.bias, 0) input_size = conv_head_dim * resolution ** 2 representation_size = cfg.MODEL.ROI_BOX_HEAD.MLP_HEAD_DIM self.fc6 = make_fc(input_size, representation_size, use_gn=False) def forward(self, x, proposals): x = self.pooler(x, proposals) x = self.xconvs(x) x = x.view(x.size(0), -1) x = F.relu(self.fc6(x)) return x def make_roi_box_feature_extractor(cfg): func = registry.ROI_BOX_FEATURE_EXTRACTORS[ cfg.MODEL.ROI_BOX_HEAD.FEATURE_EXTRACTOR ] return func(cfg)
PyTorch/Forecasting/TFT/triton/runner
runner
executor
# Copyright (c) 2021-2022, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import json import os import pathlib import shutil import traceback from typing import Dict, List, Optional from colorama import Fore # method from PEP-366 to support relative import in executed modules if __name__ == "__main__" and __package__ is None: __package__ = pathlib.Path(__file__).parent.name from ..deployment_toolkit.core import Accelerator, Precision from .core import Paths from .exceptions import RunnerException from .experiment import ExperimentResult, ExperimentStatus, Status from .exporter import CommandsExporter from .logger import LOGGER from .maintainer import Container, Maintainer from .pipeline import Pipeline from .stages import Stage from .task import Experiment, Task from .triton import Triton from .utils import clean_directory, exec_command, format_env_key, format_env_value, get_result_path class Executor: """ Experiments executor """ def __init__( self, workspace: pathlib.Path, maintainer: Maintainer, pipeline: Pipeline, devices: List[str] = None, ): """ Initialize experiments executor Args: workspace: Path to workspace to store artifacts maintainer: maintainer for running commands pipeline: pipeline definition devices: List of devices on which Triton Inference Server will be executed """ self._maintainer = maintainer self._pipeline = pipeline self._devices = devices or ["0"] self._workspace = workspace self._executor_workspace = workspace / "executor" self._shared_dir = self._executor_workspace / "shared" self._triton_models_repository_dir = self._executor_workspace / "triton_models" self._scripts_dir = self._executor_workspace / "scripts" self._libraries_dir = self._executor_workspace / "libs" self._exporter = CommandsExporter(self._scripts_dir) self._triton_container: Optional[Container] = None def start(self, task: Task): """ Process the task and execute experiments. """ self._create_dirs() total_experiment = len(task.experiments) LOGGER.info(f"Total experiments to verify: {total_experiment}") for idx, experiment in enumerate(task.experiments, start=1): LOGGER.info( f"{Fore.CYAN}================ Experiment: {idx}/{total_experiment} Started ================{Fore.RESET}" ) results = {} environment = self._prepare_environment(task, experiment.parameters) LOGGER.info(f"Experiment details") LOGGER.info(json.dumps(environment, indent=4)) self._clean_experiment_artifacts(idx, total_experiment) self._create_experiment_results_dir(task, experiment) experiment.start() LOGGER.info("Running Triton Servers:") log_file = self._workspace / task.logs_dir / f"triton-server-experiment-{idx}.log" self._triton_container = self._triton_server_container( triton_container_image=task.triton_container_image, framework=task.framework, accelerator=experiment.parameters["accelerator"], precision=experiment.parameters["precision"], custom_library=bool(task.triton_custom_operations is not None), load_model_method=task.triton_load_model_method, log_file=log_file, ) try: self._triton_container.start() for stage in self._pipeline.stages(): LOGGER.info( f"{Fore.GREEN}[Experiment: {idx}/{total_experiment}] ================ Stage {stage.label} Started ================{Fore.RESET}" ) experiment_stage = experiment.stages[stage.label] experiment_stage.start() is_ok = self._run_stage(stage=stage) if not is_ok: LOGGER.error(f"Stage {stage.label} failed.") break self._save_results(task, experiment, stage.label, results) experiment_stage.end() LOGGER.info( f"{Fore.GREEN}[Experiment: {idx}/{total_experiment}] ================ Stage {stage.label} Finished ================{Fore.RESET}" ) except Exception: message = traceback.format_exc() LOGGER.error(f"Error running experiment: {message}") yield ExperimentResult( status=Status(state=ExperimentStatus.FAILED, message=message), experiment=experiment, results=results, ) finally: self._triton_container.stop() experiment.end() LOGGER.info( f"{Fore.CYAN}================ Experiment: {idx}/{total_experiment} Finished ================{Fore.RESET}" ) yield ExperimentResult( status=Status(state=ExperimentStatus.SUCCEED, message="Experiment Succeed"), experiment=experiment, results=results, ) def stop(self) -> None: """ Stop executor Returns: None """ if self._triton_container: self._triton_container.stop() def _prepare_environment(self, task: Task, parameters: Dict) -> Dict: """ Prepare environment data and export it Args: parameters: Key and values which should be exported to environment Returns: Dictionary with environment data """ environment = { "MODEL_NAME": task.model_name, "FRAMEWORK": task.framework, "SHARED_DIR": self._shared_dir.as_posix(), "MODEL_REPOSITORY_PATH": self._triton_models_repository_dir.as_posix(), "TRITON_SERVER_URL": "localhost", "TRITON_INSTANCES": "1", "TRITON_LOAD_MODEL_METHOD": task.triton_load_model_method, } checkpoint_variant = parameters.get("checkpoint_variant") if checkpoint_variant: del parameters["checkpoint_variant"] environment["CHECKPOINT_DIR"] = task.checkpoints[checkpoint_variant].path.as_posix() if task.datasets_dir: environment["DATASETS_DIR"] = task.datasets_dir.as_posix() for key, value in parameters.items(): key = format_env_key(key) value = format_env_value(value) environment[key] = value for key, value in environment.items(): os.environ[key] = value return environment def _triton_server_container( self, triton_container_image: str, framework: str, load_model_method: str, accelerator: str, precision: str, log_file: pathlib.Path, custom_library: bool, ) -> Container: """ Create Triton Inference Server container for experiment Args: triton_container_image: Triton Inference Server container image framework: Framework used to run model accelerator: Accelerator used for experiment precision: Precision used for experiment load_model_method: Configure how Triton will load model log_file: File where Triton logs are stored Returns: Container object """ volumes = { self._triton_models_repository_dir: {"bind": Paths.MODEL_REPOSITORY_PATH, "mode": "rw"}, self._libraries_dir: {"bind": Paths.LIBRARIES_PATH, "mode": "rw"}, } environment = { "MODEL_REPOSITORY_PATH": Paths.MODEL_REPOSITORY_PATH, "LIBRARIES_PATH": Paths.LIBRARIES_PATH, "TRITON_LOAD_MODEL_METHOD": load_model_method, } if custom_library: library_path = Triton.library_path(framework=framework) environment["LD_LIBRARY_PATH"] = f"{library_path}:${{LD_LIBRARY_PATH}}" environment["LD_PRELOAD"] = Triton.custom_library_path_remote() if accelerator == Accelerator.TRT.value and precision == Precision.FP16.value: environment["ORT_TENSORRT_FP16_ENABLE"] = 1 strict_mode = False command = Triton.command( framework=framework, repository_path=Paths.MODEL_REPOSITORY_PATH, strict_mode=strict_mode, ) command = f' bash -c "{command}"' container = self._maintainer.triton_container( command=command, image=triton_container_image, devices=self._devices, volumes=volumes, environment=environment, log_file=log_file, ) return container def _save_results(self, task: Task, experiment: Experiment, stage_name: str, results: Dict) -> None: """ Update results for stage Args: task: Task object experiment: Experiment for which stage has to be updated stage_name: Name of stage results: Results path mapping Returns: None """ stage = experiment.stages[stage_name] if not stage.result_path: LOGGER.debug(f"No results file to copy for {stage.name}") return if not stage.result_type: LOGGER.debug(f"No results type provided for {stage.name}") return os.environ["SHARED_DIR"] = self._shared_dir.as_posix() result_path = get_result_path(result_path=stage.result_path) result_path = pathlib.Path(result_path) if not result_path.is_file() and not result_path.is_dir(): raise RunnerException(f"Results file {result_path} not found.") experiment_dir = self._workspace / task.results_dir / experiment.results_dir LOGGER.info(f"Saving {stage.result_type} to {experiment_dir}") if result_path.is_dir(): dst_path = experiment_dir / stage.result_type shutil.copytree(result_path, dst_path) elif result_path.is_file(): suffix = result_path.suffix dst_path = experiment_dir / f"{stage.result_type}{suffix}" shutil.copy(result_path, dst_path) else: raise RunnerException(f"Result not found {result_path}") LOGGER.info("Done") results[stage.result_type] = dst_path def _create_dirs(self) -> None: """ Create directories used to store artifacts and final results Returns: None """ LOGGER.info(f"{Fore.GREEN}================ Creating Artifacts Directories Started ================{Fore.RESET}") if self._executor_workspace.is_dir(): LOGGER.info(f"Removing previous executor workspace: {self._executor_workspace}") shutil.rmtree(self._executor_workspace) for directory in [ self._libraries_dir, self._shared_dir, self._scripts_dir, self._triton_models_repository_dir, ]: directory.mkdir(parents=True, exist_ok=True) LOGGER.info(f"Directory {directory.name} created.") LOGGER.info( f"{Fore.GREEN}================ Creating Artifacts Directories Finished ================{Fore.RESET}" ) def _clean_experiment_artifacts(self, idx: int, total: int) -> None: """ Clean artifacts stored between experiments Returns: None """ LOGGER.info( f"{Fore.GREEN}[Experiment: {idx}/{total}] ================ Cleanup Experiment Data Started ================{Fore.RESET}" ) for directory in [ self._shared_dir, self._scripts_dir, self._triton_models_repository_dir, ]: clean_directory(directory) LOGGER.info(f"Location {directory} cleaned.") LOGGER.info( f"{Fore.GREEN}[Experiment: {idx}/{total}] ================ Cleanup Experiment Data Finished ================{Fore.RESET}" ) def _create_experiment_results_dir(self, task: Task, experiment: Experiment): """ Create result directory for experiment Returns: """ experiment_dir = self._workspace / task.results_dir / experiment.results_dir experiment_dir.mkdir(parents=True, exist_ok=True) def _prepare_triton_custom_operations(self, task: Task) -> None: """ Prepare Triton Server custom operations library Returns: None """ if task.triton_custom_operations: target_library_path = Triton.custom_library_path_local(self._libraries_dir) target_library_path_dir = target_library_path.parent target_library_path_dir.mkdir(parents=True, exist_ok=True) shutil.copy(task.triton_custom_operations, target_library_path) def _run_stage(self, stage: Stage) -> bool: """ Run single stage commands Args: stage: Stage object with defined commands Returns: True on success, False otherwise """ try: command = self._exporter.export(stage=stage) exec_command(command) except RunnerException: return False return True
TensorFlow/Detection/SSD/models/research/object_detection/core
core
preprocessor_cache
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== """Records previous preprocessing operations and allows them to be repeated. Used with object_detection.core.preprocessor. Passing a PreprocessorCache into individual data augmentation functions or the general preprocess() function will store all randomly generated variables in the PreprocessorCache. When a preprocessor function is called multiple times with the same PreprocessorCache object, that function will perform the same augmentation on all calls. """ from collections import defaultdict class PreprocessorCache(object): """Dictionary wrapper storing random variables generated during preprocessing. """ # Constant keys representing different preprocessing functions ROTATION90 = 'rotation90' HORIZONTAL_FLIP = 'horizontal_flip' VERTICAL_FLIP = 'vertical_flip' PIXEL_VALUE_SCALE = 'pixel_value_scale' IMAGE_SCALE = 'image_scale' RGB_TO_GRAY = 'rgb_to_gray' ADJUST_BRIGHTNESS = 'adjust_brightness' ADJUST_CONTRAST = 'adjust_contrast' ADJUST_HUE = 'adjust_hue' ADJUST_SATURATION = 'adjust_saturation' DISTORT_COLOR = 'distort_color' STRICT_CROP_IMAGE = 'strict_crop_image' CROP_IMAGE = 'crop_image' PAD_IMAGE = 'pad_image' CROP_TO_ASPECT_RATIO = 'crop_to_aspect_ratio' RESIZE_METHOD = 'resize_method' PAD_TO_ASPECT_RATIO = 'pad_to_aspect_ratio' BLACK_PATCHES = 'black_patches' ADD_BLACK_PATCH = 'add_black_patch' SELECTOR = 'selector' SELECTOR_TUPLES = 'selector_tuples' SSD_CROP_SELECTOR_ID = 'ssd_crop_selector_id' SSD_CROP_PAD_SELECTOR_ID = 'ssd_crop_pad_selector_id' # 23 permitted function ids _VALID_FNS = [ROTATION90, HORIZONTAL_FLIP, VERTICAL_FLIP, PIXEL_VALUE_SCALE, IMAGE_SCALE, RGB_TO_GRAY, ADJUST_BRIGHTNESS, ADJUST_CONTRAST, ADJUST_HUE, ADJUST_SATURATION, DISTORT_COLOR, STRICT_CROP_IMAGE, CROP_IMAGE, PAD_IMAGE, CROP_TO_ASPECT_RATIO, RESIZE_METHOD, PAD_TO_ASPECT_RATIO, BLACK_PATCHES, ADD_BLACK_PATCH, SELECTOR, SELECTOR_TUPLES, SSD_CROP_SELECTOR_ID, SSD_CROP_PAD_SELECTOR_ID] def __init__(self): self._history = defaultdict(dict) def clear(self): """Resets cache.""" self._history = defaultdict(dict) def get(self, function_id, key): """Gets stored value given a function id and key. Args: function_id: identifier for the preprocessing function used. key: identifier for the variable stored. Returns: value: the corresponding value, expected to be a tensor or nested structure of tensors. Raises: ValueError: if function_id is not one of the 23 valid function ids. """ if function_id not in self._VALID_FNS: raise ValueError('Function id not recognized: %s.' % str(function_id)) return self._history[function_id].get(key) def update(self, function_id, key, value): """Adds a value to the dictionary. Args: function_id: identifier for the preprocessing function used. key: identifier for the variable stored. value: the value to store, expected to be a tensor or nested structure of tensors. Raises: ValueError: if function_id is not one of the 23 valid function ids. """ if function_id not in self._VALID_FNS: raise ValueError('Function id not recognized: %s.' % str(function_id)) self._history[function_id][key] = value
Tools/DGLPyTorch/SyntheticGraphGeneration/syngen/preprocessing/datasets
datasets
ogbn_mag240m
# Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import json import os import shutil from typing import Optional import numpy as np import pandas as pd from ogb.lsc import MAG240MDataset from syngen.preprocessing.base_preprocessing import BasePreprocessing from syngen.configuration import SynGenDatasetFeatureSpec from syngen.utils.io_utils import dump_dataframe from syngen.utils.types import MetaData class MAG240mPreprocessing(BasePreprocessing): def __init__( self, source_path: str, destination_path: Optional[str] = None, download: bool = False, skip_node_features=False, **kwargs, ): super().__init__(source_path, destination_path, download, **kwargs) self.include_node_features = not skip_node_features def download(self): MAG240MDataset(root=self.source_path) def _check_files(self) -> bool: return True def transform(self, gpu=False, use_cache=False): if gpu: raise ValueError("MAG240m support does not support gpu preprocessing at the moment") if use_cache and os.path.exists(self.destination_path): return SynGenDatasetFeatureSpec.instantiate_from_preprocessed(self.destination_path) shutil.rmtree(self.destination_path, ignore_errors=True) os.makedirs(self.destination_path) dataset = MAG240MDataset(root=self.source_path) graph_metadata = { MetaData.NODES: [], MetaData.EDGES: [], } # paper node type features = [] features_path = None if self.include_node_features: features_path = 'paper_tabular_features' os.makedirs(os.path.join(self.destination_path, features_path)) column_names = ["feat_" + str(i) for i in range(0, dataset.num_paper_features)] feat_memmap = dataset.paper_feat features = [ { MetaData.NAME: name, MetaData.DTYPE: str(feat_memmap.dtype), MetaData.FEATURE_TYPE: MetaData.CONTINUOUS, MetaData.FEATURE_FILE: 'paper_feats.npy' } for name in column_names ] np.save(os.path.join(self.destination_path, features_path, 'paper_feats.npy'), feat_memmap) features.append({ MetaData.NAME: 'year', MetaData.DTYPE: "int32", MetaData.FEATURE_TYPE: MetaData.CATEGORICAL, MetaData.FEATURE_FILE: 'year_label.npy' }) features.append({ MetaData.NAME: 'label', MetaData.DTYPE: "int32", MetaData.FEATURE_TYPE: MetaData.CATEGORICAL, MetaData.FEATURE_FILE: 'year_label.npy' }) year_label_df = pd.DataFrame() year_label_df['year'] = dataset.all_paper_year year_label_df['label'] = np.nan_to_num(dataset.all_paper_label, nan=-2) np.save(os.path.join(self.destination_path, features_path, 'year_label.npy'), year_label_df.values) del year_label_df paper_node_type = { MetaData.NAME: "paper", MetaData.COUNT: dataset.num_papers, MetaData.FEATURES: features, MetaData.FEATURES_PATH: features_path, } graph_metadata[MetaData.NODES].append(paper_node_type) # author node type author_node_type = { MetaData.NAME: "author", MetaData.COUNT: dataset.num_authors, MetaData.FEATURES_PATH: None, } graph_metadata[MetaData.NODES].append(author_node_type) # institution node type institution_node_type = { MetaData.NAME: "institution", MetaData.COUNT: dataset.num_institutions, MetaData.FEATURES_PATH: None, } graph_metadata[MetaData.NODES].append(institution_node_type) for (src_node_type, dst_node_type), edge_name in dataset.__rels__.items(): edges = dataset.edge_index(src_node_type, dst_node_type) structural_data = pd.DataFrame(edges.T, columns=[MetaData.SRC, MetaData.DST]) edge_type = { MetaData.NAME: edge_name, MetaData.COUNT: len(structural_data), MetaData.SRC_NODE_TYPE: src_node_type, MetaData.DST_NODE_TYPE: dst_node_type, MetaData.DIRECTED: False, MetaData.FEATURES: [], MetaData.FEATURES_PATH: None, MetaData.STRUCTURE_PATH: f"{edge_name}_list.parquet", } dump_dataframe(structural_data, os.path.join(self.destination_path, edge_type[MetaData.STRUCTURE_PATH])) graph_metadata[MetaData.EDGES].append(edge_type) with open(os.path.join(self.destination_path, 'graph_metadata.json'), 'w') as f: json.dump(graph_metadata, f, indent=4) graph_metadata[MetaData.PATH] = self.destination_path return SynGenDatasetFeatureSpec(graph_metadata) @classmethod def add_cli_args(cls, parser): parser.add_argument( "-snf", "--skip-node-features", action='store_true', help='Prepares only the structural part of the MAG240m dataset' ) return parser
PyTorch/Detection/Efficientdet/scripts/D0
D0
inference_TF32_A100-80G
#!/bin/bash rm -rf *.json python -u -m bind_launch --nproc_per_node=${NUM_PROC:-1} validate.py '/workspace/object_detection/datasets/coco/' --model efficientdet_d0 -b ${BATCH_SIZE:-8} --torchscript --use-ema --checkpoint ${CKPT_PATH:-/checkpoints/Effdet_B0.pth} --inference
Tools/DGLPyTorch/SyntheticGraphGeneration/docker_scripts
docker_scripts
run_docker_interactive
if [ ! "$(ls | grep -c docker_scripts)" -eq 1 ]; then echo "Run this script from root directory. Usage: bash ./docker_scripts/run_docker_interactive.sh" exit 1 fi IMG="${IMAGE:=graph_gen}" nvidia-docker run --rm -it \ --ipc=host \ --net=host \ -v "$(pwd)":/workspace \ ${IMG} \ bash
TensorFlow2/Classification/ConvNets/utils
utils
cmdline_helper
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import argparse import yaml def _add_bool_argument(parser, name=None, default=False, required=False, help=None): if not isinstance(default, bool): raise ValueError() feature_parser = parser.add_mutually_exclusive_group(required=required) feature_parser.add_argument('--' + name, dest=name, action='store_true', help=help, default=default) feature_parser.add_argument('--no' + name, dest=name, action='store_false') feature_parser.set_defaults(name=default) def parse_cmdline(): p = argparse.ArgumentParser(description="JoC-Efficientnet-v2-TF, full list of general hyperparameters." "Model specific hyperparameters must be provided via a config file (see --cfg)" "User config can be provided in a separate config file like config/efficientnet_v2/s_cfg.py" "Use True/False or 1/0 for boolean flags.") p.add_argument( '--cfg', type=str, default=None, required=True, help=('Path to the config file that contains the hyperparameters of your model.' 'The path must be relative to the current dir. The user can override model hyperparameters' 'in the command line (see --mparams).')) p.add_argument( '--mparams', type=str, default=None, required=False, help=('A comma seperated list of key=val where the key is a model hyperparameter and the val is the new value.' 'This flag becomes handy when you want to override the model hyperparameters placed in the model config (see --cfg).')) #######################runtime-related hparams########################## p.add_argument( '--log_steps', type=int, default=100, help='The interval of steps between logging of batch level stats.') p.add_argument( '--mode', type=str, default='train_and_eval', required=False, help='Mode to run: `train`, `eval`, `train_and_eval`, `training_benchmark` or `predict`.') p.add_argument( '--time_history', type=str, default=1, help='Enable a callback to log the time for training steps.') p.add_argument( '--use_xla', action='store_true', default=False, help='Have this flag to enable xla') p.add_argument( '--use_amp', action='store_true', default=False, help='Have this flag to enable training with automated mixed precision (AMP)') p.add_argument( '--intraop_threads', type=str, default=None, help='intra thread should match the number of CPU cores') p.add_argument( '--interop_threads', type=str, default=None, help='inter thread should match the number of CPU sockets') p.add_argument( '--model_dir', type=str, default='/results/', help=('The directory where the model and training/evaluation summaries' 'are stored. When resuming from a previous checkpoint,' 'all necessary files should be placed in this directory ')) p.add_argument('--log_dir', type=str, default=None, help=('The directory where the model and training/evaluation summaries' 'are stored. ')) p.add_argument( '--log_filename', type=str, default='log.json', help="Name of the JSON file to which write the training log") p.add_argument('--seed', type=int, default=None, required=False, help="Random seed.") # Tensor format used for the computation. p.add_argument('--data_format', choices=['channels_first', 'channels_last'], type=str, default='channels_first', required=False, help=argparse.SUPPRESS) p.add_argument('--run_eagerly', type=str, default=0, help="Set this flag 1/0 to run/disable eager execution mode.") p.add_argument('--memory_limit', type=int, default=None, help="Set the maximum GPU memory (MB) that can be allocated by tensorflow. Sometimes tensorflow" "allocates more GPU memory than it actually needs, which results in OOM or halt without stopping. Setting this to be " "slightly less than full GPU memory will help prevent this. For example, on A100 80G gpu, this value can be set to 81000") p.add_argument('--weights_format', type=str, default='ckpt', required=False, help="Whether to read pretrained weights from a ckpt or SavedModel format") #######################train-related hparams########################## # Tensor format used for the computation. p.add_argument('--train_img_size', default=224, type=int, required=False, help="Image size used for training dataset.") p.add_argument( '--max_epochs', default=300, type=int, required=False, help="Number of epochs of training.") p.add_argument( '--steps_per_epoch', default=None, type=int, required=False, help="Manually set training steps that will be executed in each epoch, leave blank to iter over the whole training dataset every epoch." ) p.add_argument('--train_batch_size', type=int, default=32, required=False, help="Training batch size per GPU.") p.add_argument('--train_use_dali', action='store_true', default=False, help='Have this flag to use dali for data loading and preprocessing of dataset, attention, dali does not support having auto-augmentation or image mixup.') ##optimizer## p.add_argument( '--optimizer', type=str, default='rmsprop', required=False, help="Optimizer to be used.") p.add_argument( '--momentum', type=float, default=0.9, required=False, help="The value of Momentum used when optimizer name is `rmsprop` or `momentum`.") p.add_argument( '--beta_1', type=float, default=0.0, required=False, help="beta1 for Adam/AdamW.") p.add_argument( '--beta_2', type=float, default=0.0, required=False, help="beta2 for Adam/AdamW..") p.add_argument( '--nesterov', action='store_true', default=False, required=False, help="nesterov bool for momentum SGD.") p.add_argument( '--opt_epsilon', type=float, default=0.001, required=False, help="The value of Epsilon for optimizer, required for `adamw`, `adam` and `rmsprop`.") p.add_argument( '--decay', type=float, default=0.9, required=False, help="The value of decay for `rmsprop`.") p.add_argument( '--weight_decay', default=5e-6, type=float, required=False, help="Weight Decay scale factor, for adamw or can be used in layers as L2 reg.") p.add_argument( '--label_smoothing', type=float, default=0.1, required=False, help="The value of label smoothing.") p.add_argument( '--moving_average_decay', type=float, default=0.0, required=False, help="Empirically it has been found that using the moving average of the trained parameters" "of a deep network is better than using its trained parameters directly. This optimizer" "allows you to compute this moving average and swap the variables at save time so that" "any code outside of the training loop will use by default the average values instead" "of the original ones.") p.add_argument( '--lookahead', action='store_true', default=False, required=False, help="Having this flag to enable lookahead, the optimizer iteratively updates two sets of weights: the search directions for weights" "are chosen by the inner optimizer, while the `slow weights` are updated each k steps" "based on the directions of the `fast weights` and the two sets of weights are " "synchronized. This method improves the learning stability and lowers the variance of" "its inner optimizer.") p.add_argument( '--intratrain_eval_using_ema', action='store_true', default=True, required=False, help="Model evaluation during training can be done using the original weights," "or using EMA weights. The latter takes place if moving_average_decay > 0 and intratrain_eval_using_ema is requested") p.add_argument( '--grad_accum_steps', type=int, default=1, required=False, help="Use multiple steps to simulate a large batch size") p.add_argument( '--grad_clip_norm', type=float, default=0, required=False, help="grad clipping is used in the custom train_step, which is called when grad_accum_steps > 1. Any non-zero value activates grad clipping") p.add_argument( '--hvd_fp16_compression', action='store_true', default=True, required=False, help="Optimize grad reducing across all workers") p.add_argument( '--export_SavedModel', action='store_true', default=False, required=False, help='Have this flag to export the trained model into SavedModel format after training is complete. When `moving_average_decay` > 0' 'it will store the set of weights with better accuracy between the original and EMA weights. This flag also has the effect of exporting the model as SavedModel at the end of evaluation.') ##lr schedule## p.add_argument('--lr_init', default=0.008, type=float, required=False, help="Initial value for the learning rate without scaling, the final learning rate is scaled by ." "lr_init * global_batch_size / 128.") p.add_argument('--lr_decay', choices=['exponential', 'piecewise_constant_with_warmup', 'cosine', 'linearcosine'], type=str, default='exponential', required=False, help="Choose from the supported decay types") p.add_argument('--lr_decay_rate', default=0.97, type=float, required=False, help="LR Decay rate for exponential decay.") p.add_argument('--lr_decay_epochs', default=2.4, type=float, required=False, help="LR Decay epoch for exponential decay.") p.add_argument('--lr_warmup_epochs', default=5, type=int, required=False, help="Number of warmup epochs for learning rate schedule.") p.add_argument('--metrics', default=['accuracy', 'top_5'], nargs='+', action='extend', required=False, help="Metrics used to evaluate the model") p.add_argument('--resume_checkpoint', action='store_true', default=True, required=False, help="Resume from a checkpoint in the model_dir.") p.add_argument('--save_checkpoint_freq', type=int, default=5, required=False, help='Number of epochs to save checkpoint.') ##progressive training## p.add_argument('--n_stages', type=int, default=1, required=False, help='Number of stages for progressive training in efficientnet_v2.') p.add_argument('--base_img_size', type=int, default=128, required=False, help='Used to determine image size for stage 1 in progressive training. Image size will then be scaled linearly until it reaches train_img_size in the last stage of training.')##Nima p.add_argument('--base_mixup', type=float, default=0, required=False, help='Mixup alpha for stage 1 in progressive training. Will then be scaled linearly until it reaches mixup_alpha in the last stage of training.')##Nima p.add_argument('--base_cutmix', type=float, default=0, required=False, help='Cutmix alpha for stage 1 in progressive training. Will then be scaled linearly until it reaches cutmix_alpha in the last stage of training.')##Nima p.add_argument('--base_randaug_mag', type=float, default=5, required=False, help='Strength of random augmentation for stage 1 in progressive training. Will then be scaled linearly until it reaches raug_magnitude in the last stage of training.')##Nima ##callbacks## p.add_argument('--enable_checkpoint_saving', action='store_true', default=True, required=False, help="saves model checkpoints during trining at desired intervals.") p.add_argument('--enable_tensorboard', action='store_true', default=False, required=False, help=argparse.SUPPRESS) p.add_argument('--tb_write_model_weights', action='store_true', default=False, required=False, help=argparse.SUPPRESS) #######################eval-related hparams########################## p.add_argument('--skip_eval', action='store_true', default=False, required=False, help="Skip eval at the end of training.") p.add_argument('--n_repeat_eval', type=int, default=1, required=False, help="Number of time to repeat evaluation. Useful to check variations in throughputs.") p.add_argument('--num_epochs_between_eval', type=int, default=1, required=False, help="Eval after how many epochs of training.") p.add_argument('--eval_use_dali', action='store_true', default=False, help='Use dali for data loading and preprocessing of eval dataset.') p.add_argument('--eval_batch_size', type=int, default=100, required=False, help="Evaluation batch size per GPU.") p.add_argument('--eval_img_size', default=224, type=int, required=False, help="Image size used for validation dataset.") #######################predict mode related hparams########################## p.add_argument('--predict_img_dir', type=str, required=False, default='/infer_data', help="Path to image to do inference on.") p.add_argument('--predict_ckpt', type=str, required=False, default=None, help="Path to checkpoint to do inference on.") p.add_argument('--predict_img_size', default=224, type=int, required=False,help="Image size used for inference.") p.add_argument('--predict_batch_size', type=int, default=32, required=False, help="Predict batch size per GPU.") p.add_argument('--benchmark', action='store_true', default=False, required=False, help="Benchmarking or not. Available in the predict mode.") ####################### data related hparams########################## p.add_argument('--dataset', type=str, default='ImageNet', required=False, help='The name of the dataset, e.g. ImageNet, etc.') p.add_argument('--augmenter_name', type=str, default='autoaugment', required=False, help="Type of Augmentation during preprocessing only during training.") ##Rand-augment params## p.add_argument('--raug_num_layers', type=int, default=None, required=False, help="Rand Augmentation parameter.") p.add_argument('--raug_magnitude', type=float, default=None, required=False, help="Rand Augmentation parameter.") p.add_argument('--cutout_const', type=float, default=None, required=False, help="Rand/Auto Augmentation parameter.") p.add_argument('--mixup_alpha', type=float, default=0., required=False, help="Mix up alpha") p.add_argument('--cutmix_alpha', type=float, default=0., required=False, help="Cut mix alpha") p.add_argument('--defer_img_mixing', action='store_true', default=False, required=False, help="Have this flag to perform image mixing in the compute graph") p.add_argument('--translate_const', type=float, default=None, required=False, help="Rand/Auto Augmentation parameter.") p.add_argument('--disable_map_parallelization', action='store_true', default=False, required=False, help="Have this flag to disable map parallelization of tf.Dataset. While this flag will hurt the throughput of multi-GPU/node sessions, it can prevent OOM errors during 1-GPU training sessions.")###Must add to scripts ##Auto-augment params p.add_argument('--autoaugmentation_name', type=str, default=None, required=False, help="Auto-Augmentation parameter.") ##Dali usage p.add_argument('--index_file', type=str, default=None, required=False, help="Path to index file required for dali.") # dataset and split p.add_argument('--data_dir', type=str, default='/data/', required=False, help='The location of the input data. Files should be named `train-*` and `validation-*`.') p.add_argument('--num_classes', type=int, default=1000, required=False, help="Number of classes to train on.") p.add_argument('--train_num_examples', type=int, default=1281167, required=False, help="Training number of examples.") p.add_argument('--eval_num_examples', type=int, default=50000, required=False, help="Evaluation number of examples") p.add_argument('--mean_subtract_in_dpipe', action='store_true', default=False, required=False, help="Whether to perform mean image subtraction in the data pipeline (dpipe) or not. If set to False, you can implement this in the compute graph.")##Nima p.add_argument('--standardize_in_dpipe', action='store_true', default=False, required=False, help="Whether to perform image standardization in the data pipeline (dpipe) or not. If set to False, you can implement this in the compute graph.")##Nima FLAGS, unknown_args = p.parse_known_args() if len(unknown_args) > 0: for bad_arg in unknown_args: print("ERROR: Unknown command line arg: %s" % bad_arg) raise ValueError("Invalid command line arg(s)") return FLAGS
CUDA-Optimized/FastSpeech/fastspeech/hparams
hparams
trt_multi_engine
parent_yaml: 'trt.yaml' # TRT trt_multi_engine: True trt_file_path_list: [ "/fastspeech/preprocessed/v0.2.0/fastspeech.i32.o256.trt", "/fastspeech/preprocessed/v0.2.0/fastspeech.i64.o512.trt", "/fastspeech/preprocessed/v0.2.0/fastspeech.i96.o768.trt", "/fastspeech/preprocessed/v0.2.0/fastspeech.i128.o1024.trt", ] trt_max_input_seq_len_list: [32, 64, 96, 128] trt_max_output_seq_len_list: [256, 512, 768, 1024] trt_file_path: "" trt_max_input_seq_len: None trt_max_output_seq_len: None
PyTorch/Segmentation/nnUNet/triton
triton
calculate_metrics
#!/usr/bin/env python3 # Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. r""" Using `calculate_metrics.py` script, you can obtain model accuracy/error metrics using defined `MetricsCalculator` class. Data provided to `MetricsCalculator` are obtained from npz dump files stored in directory pointed by `--dump-dir` argument. Above files are prepared by `run_inference_on_fw.py` and `run_inference_on_triton.py` scripts. Output data is stored in csv file pointed by `--csv` argument. Example call: ```shell script python ./triton/calculate_metrics.py \ --dump-dir /results/dump_triton \ --csv /results/accuracy_results.csv \ --metrics metrics.py \ --metric-class-param1 value ``` """ import argparse import csv import logging import string from pathlib import Path import numpy as np # method from PEP-366 to support relative import in executed modules if __package__ is None: __package__ = Path(__file__).parent.name from .deployment_toolkit.args import ArgParserGenerator from .deployment_toolkit.core import BaseMetricsCalculator, load_from_file from .deployment_toolkit.dump import pad_except_batch_axis LOGGER = logging.getLogger("calculate_metrics") TOTAL_COLUMN_NAME = "_total_" def get_data(dump_dir, prefix): """Loads and concatenates dump files for given prefix (ex. inputs, outputs, labels, ids)""" dump_dir = Path(dump_dir) npz_files = sorted(dump_dir.glob(f"{prefix}*.npz")) data = None if npz_files: # assume that all npz files with given prefix contain same set of names names = list(np.load(npz_files[0].as_posix()).keys()) # calculate target shape target_shape = { name: tuple(np.max([np.load(npz_file.as_posix())[name].shape for npz_file in npz_files], axis=0)) for name in names } # pad and concatenate data data = { name: np.concatenate( [pad_except_batch_axis(np.load(npz_file.as_posix())[name], target_shape[name]) for npz_file in npz_files] ) for name in names } return data def main(): logging.basicConfig(level=logging.INFO) parser = argparse.ArgumentParser(description="Run models with given dataloader", allow_abbrev=False) parser.add_argument("--metrics", help=f"Path to python module containing metrics calculator", required=True) parser.add_argument("--csv", help="Path to csv file", required=True) parser.add_argument("--dump-dir", help="Path to directory with dumped outputs (and labels)", required=True) args, *_ = parser.parse_known_args() MetricsCalculator = load_from_file(args.metrics, "metrics", "MetricsCalculator") ArgParserGenerator(MetricsCalculator).update_argparser(parser) args = parser.parse_args() LOGGER.info(f"args:") for key, value in vars(args).items(): LOGGER.info(f" {key} = {value}") MetricsCalculator = load_from_file(args.metrics, "metrics", "MetricsCalculator") metrics_calculator: BaseMetricsCalculator = ArgParserGenerator(MetricsCalculator).from_args(args) ids = get_data(args.dump_dir, "ids")["ids"] x = get_data(args.dump_dir, "inputs") y_true = get_data(args.dump_dir, "labels") y_pred = get_data(args.dump_dir, "outputs") common_keys = list({k for k in (y_true or [])} & {k for k in (y_pred or [])}) for key in common_keys: if y_true[key].shape != y_pred[key].shape: LOGGER.warning( f"Model predictions and labels shall have equal shapes. " f"y_pred[{key}].shape={y_pred[key].shape} != " f"y_true[{key}].shape={y_true[key].shape}" ) metrics = metrics_calculator.calc(ids=ids, x=x, y_pred=y_pred, y_real=y_true) metrics = {TOTAL_COLUMN_NAME: len(ids), **metrics} metric_names_with_space = [name for name in metrics if any([c in string.whitespace for c in name])] if metric_names_with_space: raise ValueError(f"Metric names shall have no spaces; Incorrect names: {', '.join(metric_names_with_space)}") csv_path = Path(args.csv) csv_path.parent.mkdir(parents=True, exist_ok=True) with csv_path.open("w") as csv_file: writer = csv.DictWriter(csv_file, fieldnames=list(metrics.keys())) writer.writeheader() writer.writerow(metrics) if __name__ == "__main__": main()
PyTorch/Classification/GPUNet/models
models
gpunet_builder
# Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # Copyright 2019-2022 Ross Wightman # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import os import time from collections import OrderedDict import torch import torch.nn as nn from timm.data import create_dataset, create_loader from timm.models.helpers import load_checkpoint from timm.utils import AverageMeter, accuracy from .gpunet_modules import ( ConvBnAct, EdgeResidual, Epilogue, EpilogueD, Fused_IRB, Inverted_Residual_Block, InvertedResidual, Prologue, PrologueD, PrologueLargeD, ) class GPUNet(nn.Module): def __init__(self, imgRes): super(GPUNet, self).__init__() self.imgRes = imgRes self.network = nn.Sequential() def add_layer(self, name, layer): self.network.add_module(name, layer) def forward(self, x): return self.network(x) class GPUNet_Builder: def config_checker(self, layerConfig): assert "layer_type" in layerConfig.keys() layerType = layerConfig["layer_type"] if layerType == "head": assert "num_in_channels" in layerConfig.keys() assert "num_out_channels" in layerConfig.keys() elif layerType == "tail": assert "num_in_channels" in layerConfig.keys() assert "num_out_channels" in layerConfig.keys() assert "num_classes" in layerConfig.keys() elif layerType == "irb": assert "num_in_channels" in layerConfig.keys() assert "num_out_channels" in layerConfig.keys() assert "kernel_size" in layerConfig.keys() assert "expansion" in layerConfig.keys() assert "stride" in layerConfig.keys() def test_model( self, model: nn.Module = None, testBatch: int = 10, checkpoint: str = "./pth", imgRes: tuple = (3, 224, 224), dtype: str = "fp16", val_path: str = "/mnt/dldata/", crop_pct: float = 0.942, is_prunet: bool = False, ): assert model is not None if dtype == "fp16": dtype = torch.float16 elif dtype == "fp32": dtype = torch.float32 else: raise NotImplementedError errMsg = "checkpoint not found at {}, ".format(checkpoint) errMsg += "retrieve with get_config_and_checkpoint_files " assert os.path.isfile(checkpoint) is True, errMsg if is_prunet: model.load_state_dict(torch.load(checkpoint)) else: load_checkpoint(model, checkpoint, use_ema=True) model = model.to("cuda", dtype) imagenet_val_path = val_path dataset = create_dataset( root=imagenet_val_path, name="", split="validation", load_bytes=False, class_map="", ) criterion = nn.CrossEntropyLoss().cuda() data_config = { "input_size": (3, imgRes[1], imgRes[2]), "interpolation": "bicubic", "mean": (0.485, 0.456, 0.406), "std": (0.229, 0.224, 0.225), "crop_pct": crop_pct, } print("data_config:", data_config) batch_size = testBatch loader = create_loader( dataset, input_size=data_config["input_size"], batch_size=batch_size, use_prefetcher=True, interpolation=data_config["interpolation"], mean=data_config["mean"], std=data_config["std"], num_workers=1, crop_pct=data_config["crop_pct"], pin_memory=False, tf_preprocessing=False, ) batch_time = AverageMeter() losses = AverageMeter() top1 = AverageMeter() top5 = AverageMeter() model.eval() input = torch.randn((batch_size,) + tuple(data_config["input_size"])).to( "cuda", dtype ) with torch.no_grad(): # warmup, reduce variability of first batch time # especially for comparing torchscript model(input) end = time.time() for batch_idx, (input, target) in enumerate(loader): target = target.to("cuda") input = input.to("cuda", dtype) output = model(input) loss = criterion(output, target) # measure accuracy and record loss acc1, acc5 = accuracy(output.detach(), target, topk=(1, 5)) losses.update(loss.item(), input.size(0)) top1.update(acc1.item(), input.size(0)) top5.update(acc5.item(), input.size(0)) # measure elapsed time batch_time.update(time.time() - end) end = time.time() if batch_idx % 10 == 0: print( "Test: [{0:>4d}/{1}] " "Time: {batch_time.val:.3f}s ({batch_time.avg:.3f}s, {rate_avg:>7.2f}/s) " "Loss: {loss.val:>7.4f} ({loss.avg:>6.4f}) " "Acc@1: {top1.val:>7.3f} ({top1.avg:>7.3f}) " "Acc@5: {top5.val:>7.3f} ({top5.avg:>7.3f})".format( batch_idx, len(loader), batch_time=batch_time, rate_avg=input.size(0) / batch_time.avg, loss=losses, top1=top1, top5=top5, ) ) top1a, top5a = top1.avg, top5.avg results = OrderedDict( top1=round(top1a, 4), top1_err=round(100 - top1a, 4), top5=round(top5a, 4), top5_err=round(100 - top5a, 4), img_size=data_config["input_size"][-1], interpolation=data_config["interpolation"], ) print( " * Acc@1 {:.3f} ({:.3f}) Acc@5 {:.3f} ({:.3f})".format( results["top1"], results["top1_err"], results["top5"], results["top5_err"], ) ) return results def export_onnx(self, model: GPUNet = None, name: str = "gpunet.onnx"): assert model is not None, "please input the model" x = torch.rand((1, 3, model.imgRes, model.imgRes)) torch.onnx.export(model, x, name, export_params=True, opset_version=10) def get_model(self, config: list = None): msg = "the model json needs specify whether a distilled model or not." assert "distill" in config[0].keys(), msg if config[0]["distill"]: return self._get_distill_model(config) else: return self._get_model(config) def _get_model(self, config: list = None): assert len(config) > 0 dataLayer = config[0] assert dataLayer["layer_type"] == "data" assert dataLayer["img_resolution"] > 0 imgRes = dataLayer["img_resolution"] net = GPUNet(imgRes) dropPathRateBase = 0.2 layerCount = len(config) - 1 layerCounter = 0 for layerConfig in config: dropPathRate = dropPathRateBase * layerCounter / layerCount layerCounter = layerCounter + 1 assert "layer_type" in layerConfig.keys() self.config_checker(layerConfig) layerType = layerConfig["layer_type"] if layerType == "head": name = "head: " + str(layerCounter) layer = Prologue( num_in_channels=layerConfig["num_in_channels"], num_out_channels=layerConfig["num_out_channels"], act_layer=layerConfig.get("act", "swish"), ) net.add_layer(name, layer) elif layerType == "tail": name = " layer" + str(layerCounter) layer = Epilogue( num_in_channels=layerConfig["num_in_channels"], num_out_channels=layerConfig["num_out_channels"], num_classes=layerConfig["num_classes"], ) net.add_layer(name, layer) elif layerType == "conv": name = "stage: " + str(layerConfig["stage"]) + " layer" name += str(layerCounter) layer = ConvBnAct( in_chs=layerConfig["num_in_channels"], out_chs=layerConfig["num_out_channels"], kernel_size=layerConfig["kernel_size"], stride=layerConfig["stride"], act_layer=layerConfig["act"], drop_path_rate=dropPathRate, ) net.add_layer(name, layer) elif layerType == "irb": name = "stage: " + str(layerConfig["stage"]) + " layer" name += str(layerCounter) layer = InvertedResidual( in_chs=layerConfig["num_in_channels"], out_chs=layerConfig["num_out_channels"], dw_kernel_size=layerConfig["kernel_size"], stride=layerConfig["stride"], exp_ratio=layerConfig["expansion"], use_se=layerConfig["use_se"], act_layer=layerConfig["act"], drop_path_rate=dropPathRate, ) net.add_layer(name, layer) elif layerType == "fused_irb": name = "stage: " + str(layerConfig["stage"]) + " layer" name += str(layerCounter) layer = EdgeResidual( in_chs=layerConfig["num_in_channels"], out_chs=layerConfig["num_out_channels"], exp_kernel_size=layerConfig["kernel_size"], stride=layerConfig["stride"], dilation=1, pad_type="same", exp_ratio=layerConfig["expansion"], use_se=layerConfig["use_se"], act_layer=layerConfig["act"], drop_path_rate=dropPathRate, ) net.add_layer(name, layer) elif layerType == "data": net.imgRes = layerConfig["img_resolution"] else: raise NotImplementedError net.eval() return net def _get_distill_model(self, config: list = None): assert config is not None # json -> model dataLayer = config[0] assert dataLayer["layer_type"] == "data" assert dataLayer["img_resolution"] > 0 imgRes = dataLayer["img_resolution"] net = GPUNet(imgRes) irbCounter = 0 for layerConfig in config: irbCounter = irbCounter + 1 assert "layer_type" in layerConfig.keys() self.config_checker(layerConfig) layerType = layerConfig["layer_type"] if layerType == "head": name = "head:" layer = PrologueD( num_in_channels=layerConfig["num_in_channels"], num_out_channels=layerConfig["num_out_channels"], ) net.add_layer(name, layer) elif layerType == "head_large": name = "head:" layer = PrologueLargeD( num_in_channels=layerConfig["num_in_channels"], num_out_channels=layerConfig["num_out_channels"], ) net.add_layer(name, layer) elif layerType == "tail": name = "tail:" layer = EpilogueD( num_in_channels=layerConfig["num_in_channels"], num_out_channels=layerConfig["num_out_channels"], num_classes=layerConfig["num_classes"], ) net.add_layer(name, layer) elif layerType == "irb": name = "stage: " + str(layerConfig["stage"]) + " irb" name += str(irbCounter) layer = Inverted_Residual_Block( num_in_channels=layerConfig["num_in_channels"], num_out_channels=layerConfig["num_out_channels"], kernel_size=layerConfig["kernel_size"], stride=layerConfig["stride"], expansion=layerConfig["expansion"], groups=layerConfig["groups"], ) net.add_layer(name, layer) elif layerType == "fused_irb": name = "stage: " + str(layerConfig["stage"]) + " fused_irb" name += str(irbCounter) layer = Fused_IRB( num_in_channels=layerConfig["num_in_channels"], num_out_channels=layerConfig["num_out_channels"], kernel_size=layerConfig["kernel_size"], stride=layerConfig["stride"], expansion=layerConfig["expansion"], groups=layerConfig["groups"], ) net.add_layer(name, layer) elif layerType == "data": net.imgRes = layerConfig["img_resolution"] else: raise NotImplementedError return net
TensorFlow2/LanguageModeling/BERT/scripts
scripts
run_squad_inference
#!/usr/bin/env bash # Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== echo "Container nvidia build = " $NVIDIA_BUILD_ID init_checkpoint=${1:-"/results/model.ckpt"} batch_size=${2:-"8"} precision=${3:-"fp16"} use_xla=${4:-"true"} bert_model=${5:-"large"} squad_version=${6:-"1.1"} if [ "$bert_model" = "large" ] ; then export BERT_DIR=data/download/google_pretrained_weights/uncased_L-24_H-1024_A-16 else export BERT_DIR=data/download/google_pretrained_weights/uncased_L-12_H-768_A-12 fi export SQUAD_DIR=data/download/squad/v${squad_version} export SQUAD_VERSION=v$squad_version echo "Squad directory set as " $SQUAD_DIR " BERT directory set as " $BERT_DIR echo "Results directory set as " $RESULTS_DIR use_fp16="" if [ "$precision" = "fp16" ] ; then echo "fp16 activated!" use_fp16="--use_fp16" fi if [ "$use_xla" = "true" ] ; then use_xla_tag="--enable_xla" echo "XLA activated" else use_xla_tag="" fi ckpt_str=${init_checkpoint//\//-} printf -v TAG "tf_bert_finetuning_squad_%s_inf_%s_gbs%d_ckpt_%s" "$bert_model" "$precision" $batch_size "$ckpt_str" DATESTAMP=`date +'%y%m%d%H%M%S'` #Edit to save logs & checkpoints in a different directory RESULTS_DIR=/results LOGFILE=$RESULTS_DIR/$TAG.$DATESTAMP.log printf "Logs written to %s\n" "$LOGFILE" mkdir -p $RESULTS_DIR #Check if all necessary files are available before training for DIR_or_file in $SQUAD_DIR $RESULTS_DIR $BERT_DIR/vocab.txt $BERT_DIR/bert_config.json; do if [ ! -d "$DIR_or_file" ] && [ ! -f "$DIR_or_file" ]; then echo "Error! $DIR_or_file directory missing. Please mount correctly" exit -1 fi done python run_squad.py \ --mode=predict \ --input_meta_data_path=${SQUAD_DIR}/squad_${SQUAD_VERSION}_meta_data \ --vocab_file=$BERT_DIR/vocab.txt \ --bert_config_file=$BERT_DIR/bert_config.json \ --init_checkpoint=$init_checkpoint \ --predict_file=$SQUAD_DIR/dev-v${squad_version}.json \ --predict_batch_size=$batch_size \ --model_dir=$RESULTS_DIR \ $use_fp16 $use_xla_tag python $SQUAD_DIR/evaluate-v${squad_version}.py $SQUAD_DIR/dev-v${squad_version}.json $RESULTS_DIR/predictions.json
PyTorch/LanguageModeling/BART/scripts
scripts
run_training_benchmark
#!/usr/bin/env bash # Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== BS=${1:-24} MAX_SOURCE_LEN=${2:-1024} MAX_TARGET_LEN=${3:-60} DATA_DIR=${4:-data/xsum} printf -v TAG "bart_pyt_training_benchmark" DATESTAMP=`date +'%y%m%d%H%M%S'` RESULTS_DIR=${RESULTS_DIR:-results/${TAG}_${DATESTAMP}} mkdir -p $RESULTS_DIR echo "Training for Batch size $BS Source Length $MAX_SOURCE_LEN Target Length $MAX_TARGET_LEN Data at $DATA_DIR and Config at $CONFIG_PATH" |& tee ${RESULTS_DIR}/training_benchmark.log echo "NUM_GPU Precision Throughput" |& tee ${RESULTS_DIR}/training_benchmark.log for NUM_GPU in 1 4 8; do for precision in fp16 fp32; do if [ "$precision" = "fp16" ] ; then echo "fp16 activated!" USE_FP16="--fp16" else echo "fp32/tf32 activated!" USE_FP16="" fi python finetune.py \ --data_dir=${DATA_DIR} \ --config_path=configs/config_xsum.json \ --output_dir=${RESULTS_DIR} \ --gpus ${NUM_GPU} \ --learning_rate=1e-4 \ ${USE_FP16} \ --do_train \ --n_val -1 \ --train_batch_size=${BS} --gradient_accumulation_steps=1 \ --max_epochs 1 --warmup_steps 0 \ --min_epochs=0 --val_check_interval 1.0 \ --max_source_length=${MAX_SOURCE_LEN} --max_target_length=${MAX_TARGET_LEN} \ --val_max_target_length=${MAX_TARGET_LEN} --eval_max_gen_length=${MAX_TARGET_LEN} \ --sortish_sampler \ --lr_scheduler polynomial \ --label_smoothing 0.1 \ --weight_decay 0.1 \ --dropout 0.1 --attention_dropout 0.1 --gradient_clip_val=0.1 \ --early_stopping_patience=2 \ --num_sanity_val_steps=0 --eval_beams 0 --freeze_embeds \ --amp_level=O1 --seed ${SEED:-42} |& tee -a ${RESULTS_DIR}/log_${NUM_GPU}_${precision}.log perf=`cat ${RESULTS_DIR}/log_${NUM_GPU}_${precision}.log | grep -F 'INFO:tensorflow:Throughput Average (sentences/sec) =' | tail -1 | awk -F'= ' '{print $2}'` echo "$NUM_GPU $precision $perf" |& tee ${RESULTS_DIR}/training_benchmark.log done done
PyTorch/Segmentation/nnUNet/triton/scripts/docker
docker
triton_inference_server
#!/usr/bin/env bash # Copyright (c) 2021 NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. NVIDIA_VISIBLE_DEVICES=${NVIDIA_VISIBLE_DEVICES:=all} docker run --rm -d \ -p 8000:8000 \ -p 8001:8001 \ -p 8002:8002 \ --runtime=nvidia \ -e NVIDIA_VISIBLE_DEVICES=${NVIDIA_VISIBLE_DEVICES} \ -v ${MODEL_REPOSITORY_PATH}:${MODEL_REPOSITORY_PATH} \ --shm-size=1g \ --ulimit memlock=-1 \ --ulimit stack=67108864 \ nvcr.io/nvidia/tritonserver:21.02-py3 tritonserver \ --model-store=${MODEL_REPOSITORY_PATH} \ --strict-model-config=false \ --exit-on-error=true \ --model-control-mode=explicit
PyTorch/Segmentation/nnUNet
nnUNet
requirements
git+https://github.com/NVIDIA/dllogger git+https://github.com/NVIDIA/mlperf-common.git nibabel==3.2.1 joblib==1.0.1 pytorch-lightning==1.7.7 scikit-learn==1.0 scikit-image==0.18.3 scipy==1.8.1 rich==12.5.0
TensorFlow2/Recommendation/DLRM_and_DCNv2/doc
doc
multidataset
# BYO dataset functionality overview This section describes how you can train the DeepLearningExamples RecSys models on your own datasets without changing the model or data loader and with similar performance to the one published in each repository. This can be achieved thanks to Dataset Feature Specification, which describes how the dataset, data loader and model interact with each other during training, inference and evaluation. Dataset Feature Specification has a consistent format across all recommendation models in NVIDIA’s DeepLearningExamples repository, regardless of dataset file type and the data loader, giving you the flexibility to train RecSys models on your own datasets. - [Glossary](#glossary) - [Dataset Feature Specification](#dataset-feature-specification) - [Data Flow in Recommendation Models in DeepLearning examples](#data-flow-in-nvidia-deep-learning-examples-recommendation-models) - [Example of Dataset Feature Specification](#example-of-dataset-feature-specification) - [BYO dataset functionality](#byo-dataset-functionality) ## Glossary The Dataset Feature Specification consists of three mandatory and one optional section: <b>feature_spec </b> provides a base of features that may be referenced in other sections, along with their metadata. Format: dictionary (feature name) => (metadata name => metadata value)<br> <b>source_spec </b> provides information necessary to extract features from the files that store them. Format: dictionary (mapping name) => (list of chunks)<br> * <i>Mappings</i> are used to represent different versions of the dataset (think: train/validation/test, k-fold splits). A mapping is a list of chunks.<br> * <i>Chunks</i> are subsets of features that are grouped together for saving. For example, some formats may constrain data saved in one file to a single data type. In that case, each data type would correspond to at least one chunk. Another example where this might be used is to reduce file size and enable more parallel loading. Chunk description is a dictionary of three keys:<br> * <i>type</i> provides information about the format in which the data is stored. Not all formats are supported by all models.<br> * <i>features</i> is a list of features that are saved in a given chunk. Order of this list may matter: for some formats, it is crucial for assigning read data to the proper feature.<br> * <i>files</i> is a list of paths to files where the data is saved. For Feature Specification in yaml format, these paths are assumed to be relative to the yaml file’s directory (basename). <u>Order of this list matters:</u> It is assumed that rows 1 to i appear in the first file, rows i+1 to j in the next one, etc. <br> <b>channel_spec</b> determines how features are used. It is a mapping (channel name) => (list of feature names). Channels are model specific magic constants. In general, data within a channel is processed using the same logic. Example channels: model output (labels), categorical ids, numerical inputs, user data, and item data. <b>metadata</b> is a catch-all, wildcard section: If there is some information about the saved dataset that does not fit into the other sections, you can store it here. ## Dataset feature specification Data flow can be described abstractly: Input data consists of a list of rows. Each row has the same number of columns; each column represents a feature. The columns are retrieved from the input files, loaded, aggregated into channels and supplied to the model/training script. FeatureSpec contains metadata to configure this process and can be divided into three parts: * Specification of how data is organized on disk (source_spec). It describes which feature (from feature_spec) is stored in which file and how files are organized on disk. * Specification of features (feature_spec). Describes a dictionary of features, where key is feature name and values are features’ characteristics such as dtype and other metadata (for example, cardinalities for categorical features) * Specification of model’s inputs and outputs (channel_spec). Describes a dictionary of model’s inputs where keys specify model channel’s names and values specify lists of features to be loaded into that channel. Model’s channels are groups of data streams to which common model logic is applied, for example categorical/continuous data, user/item ids. Required/available channels depend on the model The FeatureSpec is a common form of description regardless of underlying dataset format, dataset data loader form and model. ## Data flow in NVIDIA Deep Learning Examples recommendation models The typical data flow is as follows: * <b>S.0.</b> Original dataset is downloaded to a specific folder. * <b>S.1.</b> Original dataset is preprocessed into Intermediary Format. For each model, the preprocessing is done differently, using different tools. The Intermediary Format also varies (for example, for DLRM PyTorch, the Intermediary Format is a custom binary one.) * <b>S.2.</b> The Preprocessing Step outputs Intermediary Format with dataset split into training and validation/testing parts along with the Dataset Feature Specification yaml file. Metadata in the preprocessing step is automatically calculated. * <b>S.3.</b> Intermediary Format data together with Dataset Feature Specification are fed into training/evaluation scripts. Data loader reads Intermediary Format and feeds the data into the model according to the description in the Dataset Feature Specification. * <b>S.4.</b> The model is trained and evaluated <p align="center"> <img width="70%" src="./img/df_diagram.png" /> <br> Fig.1. Data flow in Recommender models in NVIDIA Deep Learning Examples repository. Channels of the model are drawn in green</a>. </p> ### Example of dataset feature specification As an example, let’s consider a Dataset Feature Specification for a small CSV dataset for some abstract model. ```yaml feature_spec: user_gender: dtype: torch.int8 cardinality: 3 #M,F,Other user_age: #treated as numeric value dtype: torch.int8 user_id: dtype: torch.int32 cardinality: 2655 item_id: dtype: torch.int32 cardinality: 856 label: dtype: torch.float32 source_spec: train: - type: csv features: - user_gender - user_age files: - train_data_0_0.csv - train_data_0_1.csv - type: csv features: - user_id - item_id - label files: - train_data_1.csv test: - type: csv features: - user_id - item_id - label - user_gender - user_age files: - test_data.csv channel_spec: numeric_inputs: - user_age categorical_user_inputs: - user_gender - user_id categorical_item_inputs: - item_id label_ch: - label ``` The data contains five features: (user_gender, user_age, user_id, item_id, label). Their data types and necessary metadata are described in the feature specification section. In the source mapping section, two mappings are provided: one describes the layout of the training data, the other of the testing data. The layout for training data has been chosen arbitrarily to showcase the flexibility. The train mapping consists of two chunks. The first one contains user_gender and user_age, saved as a CSV, and is further broken down into two files. For specifics of the layout, refer to the following example and consult the glossary. The second chunk contains the remaining columns and is saved in a single file. Notice that the order of columns is different in the second chunk - this is alright, as long as the order matches the order in that file (that is, columns in the .csv are also switched) Let’s break down the train source mapping. The table contains example data color-paired to the files containing it. <p align="center"> <img width="70%" src="./img/layout_example.png" /> </p> The channel spec describes how the data will be consumed. Four streams will be produced and available to the script/model. The feature specification does not specify what happens further: names of these streams are only lookup constants defined by the model/script. Based on this example, we can speculate that the model has three input channels: numeric_inputs, categorical_user_inputs, categorical_item_inputs, and one output channel: label. Feature names are internal to the FeatureSpec and can be freely modified. ### BYO dataset functionality In order to train any Recommendation model in NVIDIA Deep Learning Examples one can follow one of three possible ways: * One delivers already preprocessed dataset in the Intermediary Format supported by data loader used by the training script (different models use different data loaders) together with FeatureSpec yaml file describing at least specification of dataset, features and model channels * One uses a transcoding script * One delivers dataset in non-preprocessed form and uses preprocessing scripts that are a part of the model repository. In order to use already existing preprocessing scripts, the format of the dataset needs to match the one of the original datasets. This way, the FeatureSpec file will be generated automatically, but the user will have the same preprocessing as in the original model repository. ### BYO dataset The BYO dataset functionality allows users to plug in their dataset in a common fashion for all Recommender models that support this functionality. Using BYO dataset functionality, the user does not have to modify the source code of the model thanks to the Feature Specification file. For general information on how BYO dataset works, refer to the [BYO dataset overview section](#byo-dataset-functionality-overview). There are three ways to plug in user's dataset: <details> <summary><b>1. Provide an unprocessed dataset in a format matching the one used by Criteo 1TB, then use Criteo 1TB's preprocessing. Feature Specification file is then generated automatically.</b></summary> The required format of the user's dataset is: The data should be split into text files. Each line of those text files should contain a single training example. An example should consist of multiple fields separated by tabulators: * The first field is the label – 1 for a positive example and 0 for negative. * The next N tokens should contain the numerical features separated by tabs. * The next M tokens should contain the hashed categorical features separated by tabs. The correct dataset files together with the Feature Specification yaml file will be generated automatically by preprocessing script. For an example of using this process, refer to the [Quick Start Guide](#quick-start-guide) </details> <details> <summary><b>2. Provide a CSV containing preprocessed data and a simplified Feature Specification yaml file, then transcode the data with `transcode.py` script </b> </summary> This option should be used if the user has their own CSV file with a preprocessed dataset they want to train on. The required format of the user's dataset is: * CSV files containing the data, already split into train and test sets. * Feature Specification yaml file describing the layout of the CSV data For an example of a feature specification file, refer to the `tests/transcoding` folder. The CSV containing the data: * should be already split into train and test * should contain no header * should contain one column per feature, in the order specified by the list of features for that chunk in the source_spec section of the feature specification file * categorical features should be non-negative integers in the range [0,cardinality-1] if cardinality is specified The Feature Specification yaml file: * needs to describe the layout of data in CSV files * may contain information about cardinalities. However, if set to `auto`, they will be inferred from the data by the transcoding script. Refer to `tests/transcoding/small_csv.yaml` for an example of the yaml Feature Specification. The following example shows how to use this way of plugging user's dataset: Prepare your data and save the path: ```bash DATASET_PARENT_DIRECTORY=/raid/dlrm ``` Build the DLRM image with: ```bash docker build -t nvidia_dlrm_tf . ``` Launch the container with: ```bash docker run --cap-add SYS_NICE --runtime=nvidia -it --rm --ipc=host -v ${DATASET_PARENT_DIRECTORY}/data:/data nvidia_dlrm_tf bash ``` If you are just testing the process, you can create synthetic csv data: ```bash python gen_csv.py --feature_spec_in tests/transcoding/small_csv.yaml ``` Convert the data: ```bash mkdir /data/conversion_output cp tests/transcoding/small_csv.yaml /data/feature_spec.yaml python transcode.py --input /data --output /data/converted ``` You may need to tune the --chunk_size parameter. Higher values speed up the conversion but require more RAM. This will convert the data from `/data` and save the output in `/data/converted`. A feature specification file describing the new data will be automatically generated. To run the training on 1 GPU: ```bash horovodrun -np 1 -H localhost:1 --mpi-args=--oversubscribe numactl --interleave=all -- python -u main.py --dataset_path /data/converted --amp --xla ``` - multi-GPU for DGX A100: ```bash horovodrun -np 8 -H localhost:8 --mpi-args=--oversubscribe numactl --interleave=all -- python -u main.py --dataset_path /data/converted --amp --xla ``` - multi-GPU for DGX-1 and DGX-2: ```bash horovodrun -np 8 -H localhost:8 --mpi-args=--oversubscribe numactl --interleave=all -- python -u main.py --dataset_path /data/converted --amp --xla ``` </details> <details> <summary><b>3. Provide a fully preprocessed dataset, saved in split binary files, and a Feature Specification yaml file</b></summary> This is the option to choose if you want full control over preprocessing and/or want to preprocess data directly to the target format. Your final output will need to contain a Feature Specification yaml describing data and file layout. For an example feature specification file, refer to `tests/feature_specs/criteo_f15.yaml` For details, refer to the [BYO dataset overview section](#byo-dataset-functionality-overview). </details> #### Channel definitions and requirements This model defines three channels: - categorical, accepting an arbitrary number of features - numerical, accepting an arbitrary number of features - label, accepting a single feature The training script expects two mappings: - train - test For performance reasons: * The only supported dataset type is split binary * Splitting chunks into multiple files is not supported. * Each categorical feature has to be provided in a separate chunk * All numerical features have to be provided in a single chunk * All numerical features have to appear in the same order in channel_spec and source_spec * Only integer types are supported for categorical features * Only float16 is supported for numerical features #### BYO dataset constraints for the model There are the following constraints of BYO dataset functionality for this model: 1. The performance of the model depends on the dataset size. Generally, the model should scale better for datasets containing more data points. For a smaller dataset, you might experience slower performance than the one reported for Criteo 2. Using other datasets might require tuning some hyperparameters (for example, learning rate, beta1 and beta2) to reach desired accuracy. 3. The optimized cuda interaction kernels for FP16 and TF32 assume that the number of categorical variables is smaller than WARP_SIZE=32 and embedding size is <=128
TensorFlow2/LanguageModeling/ELECTRA/data
data
SquadDownloader
# Copyright (c) 2019 NVIDIA CORPORATION. All rights reserved. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import bz2 import os import urllib.request import sys class SquadDownloader: def __init__(self, save_path): self.save_path = save_path + '/squad' if not os.path.exists(self.save_path): os.makedirs(self.save_path) if not os.path.exists(self.save_path + '/v1.1'): os.makedirs(self.save_path + '/v1.1') if not os.path.exists(self.save_path + '/v2.0'): os.makedirs(self.save_path + '/v2.0') self.download_urls = { 'https://rajpurkar.github.io/SQuAD-explorer/dataset/train-v1.1.json' : 'v1.1/train-v1.1.json', 'https://rajpurkar.github.io/SQuAD-explorer/dataset/dev-v1.1.json' : 'v1.1/dev-v1.1.json', 'https://worksheets.codalab.org/rest/bundles/0xbcd57bee090b421c982906709c8c27e1/contents/blob/' : 'v1.1/evaluate-v1.1.py', 'https://rajpurkar.github.io/SQuAD-explorer/dataset/train-v2.0.json' : 'v2.0/train-v2.0.json', 'https://rajpurkar.github.io/SQuAD-explorer/dataset/dev-v2.0.json' : 'v2.0/dev-v2.0.json', 'https://worksheets.codalab.org/rest/bundles/0x6b567e1cf2e041ec80d7098f031c5c9e/contents/blob/' : 'v2.0/evaluate-v2.0.py', } def download(self): for item in self.download_urls: url = item file = self.download_urls[item] print('Downloading:', url) if os.path.isfile(self.save_path + '/' + file): print('** Download file already exists, skipping download') else: response = urllib.request.urlopen(url) with open(self.save_path + '/' + file, "wb") as handle: handle.write(response.read())
PyTorch/Classification/GPUNet/triton/deployment_toolkit/triton_performance_runner/perf_analyzer
perf_analyzer
exceptions
# Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. class PerfAnalyzerException(Exception): def __init__(self, message: str): self._message = message def __str__(self): """ Get the exception string representation. Returns ------- str The message associated with this exception, or None if no message. """ return self._message @property def message(self): """ Get the exception message. Returns ------- str The message associated with this exception, or None if no message. """ return self._message
TensorFlow/Detection/SSD/models/research/object_detection/metrics
metrics
oid_od_challenge_evaluation_utils
# Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== r"""Converts data from CSV to the OpenImagesDetectionChallengeEvaluator format. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function from object_detection.core import standard_fields def build_groundtruth_boxes_dictionary(data, class_label_map): """Builds a groundtruth dictionary from groundtruth data in CSV file. Args: data: Pandas DataFrame with the groundtruth data for a single image. class_label_map: Class labelmap from string label name to an integer. Returns: A dictionary with keys suitable for passing to OpenImagesDetectionChallengeEvaluator.add_single_ground_truth_image_info: standard_fields.InputDataFields.groundtruth_boxes: float32 numpy array of shape [num_boxes, 4] containing `num_boxes` groundtruth boxes of the format [ymin, xmin, ymax, xmax] in absolute image coordinates. standard_fields.InputDataFields.groundtruth_classes: integer numpy array of shape [num_boxes] containing 1-indexed groundtruth classes for the boxes. standard_fields.InputDataFields.verified_labels: integer 1D numpy array containing all classes for which labels are verified. standard_fields.InputDataFields.groundtruth_group_of: Optional length M numpy boolean array denoting whether a groundtruth box contains a group of instances. """ data_boxes = data[data.ConfidenceImageLabel.isnull()] data_labels = data[data.XMin.isnull()] return { standard_fields.InputDataFields.groundtruth_boxes: data_boxes[['YMin', 'XMin', 'YMax', 'XMax']].as_matrix(), standard_fields.InputDataFields.groundtruth_classes: data_boxes['LabelName'].map(lambda x: class_label_map[x]).as_matrix(), standard_fields.InputDataFields.groundtruth_group_of: data_boxes['IsGroupOf'].as_matrix().astype(int), standard_fields.InputDataFields.groundtruth_image_classes: data_labels['LabelName'].map(lambda x: class_label_map[x]) .as_matrix(), } def build_predictions_dictionary(data, class_label_map): """Builds a predictions dictionary from predictions data in CSV file. Args: data: Pandas DataFrame with the predictions data for a single image. class_label_map: Class labelmap from string label name to an integer. Returns: Dictionary with keys suitable for passing to OpenImagesDetectionChallengeEvaluator.add_single_detected_image_info: standard_fields.DetectionResultFields.detection_boxes: float32 numpy array of shape [num_boxes, 4] containing `num_boxes` detection boxes of the format [ymin, xmin, ymax, xmax] in absolute image coordinates. standard_fields.DetectionResultFields.detection_scores: float32 numpy array of shape [num_boxes] containing detection scores for the boxes. standard_fields.DetectionResultFields.detection_classes: integer numpy array of shape [num_boxes] containing 1-indexed detection classes for the boxes. """ return { standard_fields.DetectionResultFields.detection_boxes: data[['YMin', 'XMin', 'YMax', 'XMax']].as_matrix(), standard_fields.DetectionResultFields.detection_classes: data['LabelName'].map(lambda x: class_label_map[x]).as_matrix(), standard_fields.DetectionResultFields.detection_scores: data['Score'].as_matrix() }
TensorFlow/Detection/SSD/examples
examples
SSD320_inference
# # Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import sys from absl import flags from time import time import tensorflow as tf import dllogger from object_detection import model_hparams from object_detection import model_lib from object_detection.utils.exp_utils import setup_dllogger import numpy as np flags.DEFINE_string('checkpoint_dir', None, 'Path to directory holding a checkpoint. If ' '`checkpoint_dir` is not provided, benchmark is running on random model') flags.DEFINE_string('pipeline_config_path', None, 'Path to pipeline config file.') flags.DEFINE_string("raport_file", default="summary.json", help="Path to dlloger json") flags.DEFINE_integer('warmup_iters', 100, 'Number of iterations skipped during benchmark') flags.DEFINE_integer('benchmark_iters', 300, 'Number of iterations measured by benchmark') flags.DEFINE_integer('batch_size', 1, 'Number of inputs processed paralelly') flags.DEFINE_list("percentiles", default=['90', '95', '99'], help="percentiles for latency confidence intervals") FLAGS = flags.FLAGS flags.mark_flag_as_required('pipeline_config_path') def build_estimator(): session_config = tf.ConfigProto() config = tf.estimator.RunConfig(session_config=session_config) train_and_eval_dict = model_lib.create_estimator_and_inputs( run_config=config, hparams=model_hparams.create_hparams(None), pipeline_config_path=FLAGS.pipeline_config_path) estimator = train_and_eval_dict['estimator'] eval_input_fns = train_and_eval_dict['eval_input_fns'] return estimator, eval_input_fns[0] def build_benchmark_input_fn(input_fn): def benchmark_input_fn(params={}): params['batch_size'] = FLAGS.batch_size return input_fn(params).repeat().take(FLAGS.warmup_iters + FLAGS.benchmark_iters) return benchmark_input_fn class TimingHook(tf.train.SessionRunHook): def __init__(self): super(TimingHook, self).__init__() setup_dllogger(enabled=True, filename=FLAGS.raport_file) self.times = [] def before_run(self, *args, **kwargs): super(TimingHook, self).before_run(*args, **kwargs) self.start_time = time() def log_progress(self): if sys.stdout.isatty(): print(len(self.times) - FLAGS.warmup_iters, '/', FLAGS.benchmark_iters, ' '*10, end='\r') def after_run(self, *args, **kwargs): super(TimingHook, self).after_run(*args, **kwargs) self.times.append(time() - self.start_time) self.log_progress() def end(self, *args, **kwargs): super(TimingHook, self).end(*args, **kwargs) throughput = sum([1/x for x in self.times[FLAGS.warmup_iters:]]) * FLAGS.batch_size / FLAGS.benchmark_iters latency_avg = 1000 * sum(self.times[FLAGS.warmup_iters:]) / FLAGS.benchmark_iters latency_data = 1000 * np.array(self.times[FLAGS.warmup_iters:]) summary = { 'infer_throughput': throughput, 'eval_avg_latency': latency_avg } print() print('Benchmark result:', throughput, 'img/s') for p in FLAGS.percentiles: p = int(p) tf.logging.info("Latency {}%: {:>4.2f} ms".format( p, np.percentile(latency_data, p))) summary[f'eval_{p}%_latency'] = np.percentile(latency_data, p) dllogger.log(step=tuple(), data=summary) def main(unused_argv): tf.logging.set_verbosity(tf.logging.INFO) estimator, eval_input_fn = build_estimator() checkpoint_path = tf.train.latest_checkpoint(FLAGS.checkpoint_dir) \ if FLAGS.checkpoint_dir \ else None results = estimator.predict( input_fn=build_benchmark_input_fn(eval_input_fn), checkpoint_path=checkpoint_path, hooks=[ TimingHook() ], yield_single_examples=False ) list(results) if __name__ == '__main__': tf.app.run()
TensorFlow2/Classification/ConvNets/efficientnet_v2/S/evaluation
evaluation
evaluation_FP32_V100-32G
# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. python main.py \ --cfg config/efficientnet_v2/s_cfg.py \ --mode eval \ --use_xla \ --eval_batch_size 128 \ --eval_img_size 384 \ --model_dir ./output/expXX \ --n_repeat_eval 4 \ --moving_average_decay 0.9999 # enables evaluation using EMA weights too
Tools/DGLPyTorch/SyntheticGraphGeneration/docker_scripts
docker_scripts
build_docker
if [ ! "$(ls | grep -c docker_scripts)" -eq 1 ]; then echo "Run this script from root directory. Usage: bash ./docker_scripts/build_docker.sh" exit 1 fi IMG="${IMAGE:=graph_gen}" docker build . -t ${IMG}
Kaldi/SpeechRecognition/kaldi-asr-backend
kaldi-asr-backend
CMakeLists
# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the following disclaimer. # * Redistributions in binary form must reproduce the above copyright # notice, this list of conditions and the following disclaimer in the # documentation and/or other materials provided with the distribution. # * Neither the name of NVIDIA CORPORATION nor the names of its # contributors may be used to endorse or promote products derived # from this software without specific prior written permission. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY # EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR # PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY # OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. cmake_minimum_required(VERSION 3.17..3.20) project(TritonKaldiBackend LANGUAGES C CXX) # # Options # # Must include options required for this project as well as any # projects included in this one by FetchContent. # # GPU support is enabled by default because the Kaldi backend requires GPUs. # option(TRITON_ENABLE_GPU "Enable GPU support in backend" ON) option(TRITON_ENABLE_STATS "Include statistics collections in backend" ON) set(TRITON_COMMON_REPO_TAG "r21.05" CACHE STRING "Tag for triton-inference-server/common repo") set(TRITON_CORE_REPO_TAG "r21.05" CACHE STRING "Tag for triton-inference-server/core repo") set(TRITON_BACKEND_REPO_TAG "r21.05" CACHE STRING "Tag for triton-inference-server/backend repo") if(NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE Release) endif() # # Dependencies # # FetchContent's composibility isn't very good. We must include the # transitive closure of all repos so that we can override the tag. # include(FetchContent) FetchContent_Declare( repo-common GIT_REPOSITORY https://github.com/triton-inference-server/common.git GIT_TAG ${TRITON_COMMON_REPO_TAG} GIT_SHALLOW ON ) FetchContent_Declare( repo-core GIT_REPOSITORY https://github.com/triton-inference-server/core.git GIT_TAG ${TRITON_CORE_REPO_TAG} GIT_SHALLOW ON ) FetchContent_Declare( repo-backend GIT_REPOSITORY https://github.com/triton-inference-server/backend.git GIT_TAG ${TRITON_BACKEND_REPO_TAG} GIT_SHALLOW ON ) FetchContent_MakeAvailable(repo-common repo-core repo-backend) # # Shared library implementing the Triton Backend API # add_library(triton-kaldi-backend SHARED) add_library(TritonKaldiBackend::triton-kaldi-backend ALIAS triton-kaldi-backend) target_sources(triton-kaldi-backend PRIVATE triton-kaldi-backend.cc kaldi-backend-utils.cc kaldi-backend-utils.h ) target_include_directories(triton-kaldi-backend SYSTEM PRIVATE $<$<BOOL:${TRITON_ENABLE_GPU}>:${CUDA_INCLUDE_DIRS}> /opt/kaldi/src /opt/kaldi/tools/openfst/include ) target_include_directories(triton-kaldi-backend PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} ) target_compile_features(triton-kaldi-backend PRIVATE cxx_std_17) target_compile_options(triton-kaldi-backend PRIVATE $<$<OR:$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:AppleClang>,$<CXX_COMPILER_ID:GNU>>:-Wall -Wextra -Wno-unused-parameter -Wno-type-limits -Werror> ) target_link_directories(triton-kaldi-backend PRIVATE /opt/kaldi/src/lib ) target_link_libraries(triton-kaldi-backend PRIVATE TritonCore::triton-core-serverapi # from repo-core TritonCore::triton-core-backendapi # from repo-core TritonCore::triton-core-serverstub # from repo-core TritonBackend::triton-backend-utils # from repo-backend -lkaldi-cudadecoder ) set_target_properties(triton-kaldi-backend PROPERTIES POSITION_INDEPENDENT_CODE ON OUTPUT_NAME triton_kaldi ) # # Install # include(GNUInstallDirs) install( TARGETS triton-kaldi-backend EXPORT triton-kaldi-backend-targets LIBRARY DESTINATION ${CMAKE_INSTALL_PREFIX}/backends/kaldi ARCHIVE DESTINATION ${CMAKE_INSTALL_PREFIX}/backends/kaldi )
TensorFlow2/Recommendation/DLRM_and_DCNv2/tests/feature_specs
feature_specs
20_num
channel_spec: categorical: - cat_0.bin - cat_1.bin - cat_2.bin - cat_3.bin - cat_4.bin - cat_5.bin - cat_6.bin - cat_7.bin - cat_8.bin - cat_9.bin - cat_10.bin - cat_11.bin - cat_12.bin - cat_13.bin - cat_14.bin - cat_15.bin - cat_16.bin - cat_17.bin - cat_18.bin - cat_19.bin - cat_20.bin - cat_21.bin - cat_22.bin - cat_23.bin - cat_24.bin - cat_25.bin label: - label numerical: &id001 - num_0 - num_1 - num_2 - num_3 - num_4 - num_5 - num_6 - num_7 - num_8 - num_9 - num_10 - num_11 - num_12 - num_13 - num_14 - num_15 - num_16 - num_17 - num_18 - num_19 feature_spec: cat_0.bin: cardinality: 100000 dtype: int32 cat_1.bin: cardinality: 100001 dtype: int32 cat_10.bin: cardinality: 100010 dtype: int32 cat_11.bin: cardinality: 100011 dtype: int32 cat_12.bin: cardinality: 100012 dtype: int32 cat_13.bin: cardinality: 100013 dtype: int32 cat_14.bin: cardinality: 100014 dtype: int32 cat_15.bin: cardinality: 100015 dtype: int32 cat_16.bin: cardinality: 100016 dtype: int32 cat_17.bin: cardinality: 100017 dtype: int32 cat_18.bin: cardinality: 100018 dtype: int32 cat_19.bin: cardinality: 100019 dtype: int32 cat_2.bin: cardinality: 100002 dtype: int32 cat_20.bin: cardinality: 100020 dtype: int32 cat_21.bin: cardinality: 100021 dtype: int32 cat_22.bin: cardinality: 100022 dtype: int32 cat_23.bin: cardinality: 100023 dtype: int32 cat_24.bin: cardinality: 100024 dtype: int32 cat_25.bin: cardinality: 100025 dtype: int32 cat_3.bin: cardinality: 100003 dtype: int32 cat_4.bin: cardinality: 100004 dtype: int32 cat_5.bin: cardinality: 100005 dtype: int32 cat_6.bin: cardinality: 100006 dtype: int32 cat_7.bin: cardinality: 100007 dtype: int32 cat_8.bin: cardinality: 100008 dtype: int32 cat_9.bin: cardinality: 100009 dtype: int32 label: dtype: bool num_0: dtype: float16 num_1: dtype: float16 num_10: dtype: float16 num_11: dtype: float16 num_12: dtype: float16 num_13: dtype: float16 num_14: dtype: float16 num_15: dtype: float16 num_16: dtype: float16 num_17: dtype: float16 num_18: dtype: float16 num_19: dtype: float16 num_2: dtype: float16 num_3: dtype: float16 num_4: dtype: float16 num_5: dtype: float16 num_6: dtype: float16 num_7: dtype: float16 num_8: dtype: float16 num_9: dtype: float16 metadata: {} source_spec: test: - features: *id001 files: - test/numerical.bin type: split_binary - features: - label files: - test/label.bin type: split_binary - features: - cat_0.bin files: - test/cat_0.bin type: split_binary - features: - cat_1.bin files: - test/cat_1.bin type: split_binary - features: - cat_2.bin files: - test/cat_2.bin type: split_binary - features: - cat_3.bin files: - test/cat_3.bin type: split_binary - features: - cat_4.bin files: - test/cat_4.bin type: split_binary - features: - cat_5.bin files: - test/cat_5.bin type: split_binary - features: - cat_6.bin files: - test/cat_6.bin type: split_binary - features: - cat_7.bin files: - test/cat_7.bin type: split_binary - features: - cat_8.bin files: - test/cat_8.bin type: split_binary - features: - cat_9.bin files: - test/cat_9.bin type: split_binary - features: - cat_10.bin files: - test/cat_10.bin type: split_binary - features: - cat_11.bin files: - test/cat_11.bin type: split_binary - features: - cat_12.bin files: - test/cat_12.bin type: split_binary - features: - cat_13.bin files: - test/cat_13.bin type: split_binary - features: - cat_14.bin files: - test/cat_14.bin type: split_binary - features: - cat_15.bin files: - test/cat_15.bin type: split_binary - features: - cat_16.bin files: - test/cat_16.bin type: split_binary - features: - cat_17.bin files: - test/cat_17.bin type: split_binary - features: - cat_18.bin files: - test/cat_18.bin type: split_binary - features: - cat_19.bin files: - test/cat_19.bin type: split_binary - features: - cat_20.bin files: - test/cat_20.bin type: split_binary - features: - cat_21.bin files: - test/cat_21.bin type: split_binary - features: - cat_22.bin files: - test/cat_22.bin type: split_binary - features: - cat_23.bin files: - test/cat_23.bin type: split_binary - features: - cat_24.bin files: - test/cat_24.bin type: split_binary - features: - cat_25.bin files: - test/cat_25.bin type: split_binary train: - features: *id001 files: - train/numerical.bin type: split_binary - features: - label files: - train/label.bin type: split_binary - features: - cat_0.bin files: - train/cat_0.bin type: split_binary - features: - cat_1.bin files: - train/cat_1.bin type: split_binary - features: - cat_2.bin files: - train/cat_2.bin type: split_binary - features: - cat_3.bin files: - train/cat_3.bin type: split_binary - features: - cat_4.bin files: - train/cat_4.bin type: split_binary - features: - cat_5.bin files: - train/cat_5.bin type: split_binary - features: - cat_6.bin files: - train/cat_6.bin type: split_binary - features: - cat_7.bin files: - train/cat_7.bin type: split_binary - features: - cat_8.bin files: - train/cat_8.bin type: split_binary - features: - cat_9.bin files: - train/cat_9.bin type: split_binary - features: - cat_10.bin files: - train/cat_10.bin type: split_binary - features: - cat_11.bin files: - train/cat_11.bin type: split_binary - features: - cat_12.bin files: - train/cat_12.bin type: split_binary - features: - cat_13.bin files: - train/cat_13.bin type: split_binary - features: - cat_14.bin files: - train/cat_14.bin type: split_binary - features: - cat_15.bin files: - train/cat_15.bin type: split_binary - features: - cat_16.bin files: - train/cat_16.bin type: split_binary - features: - cat_17.bin files: - train/cat_17.bin type: split_binary - features: - cat_18.bin files: - train/cat_18.bin type: split_binary - features: - cat_19.bin files: - train/cat_19.bin type: split_binary - features: - cat_20.bin files: - train/cat_20.bin type: split_binary - features: - cat_21.bin files: - train/cat_21.bin type: split_binary - features: - cat_22.bin files: - train/cat_22.bin type: split_binary - features: - cat_23.bin files: - train/cat_23.bin type: split_binary - features: - cat_24.bin files: - train/cat_24.bin type: split_binary - features: - cat_25.bin files: - train/cat_25.bin type: split_binary
PyTorch/Segmentation/MaskRCNN/pytorch/tests
tests
test_data_samplers
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. import itertools import random import unittest from torch.utils.data.sampler import BatchSampler from torch.utils.data.sampler import Sampler from torch.utils.data.sampler import SequentialSampler from torch.utils.data.sampler import RandomSampler from maskrcnn_benchmark.data.samplers import GroupedBatchSampler from maskrcnn_benchmark.data.samplers import IterationBasedBatchSampler class SubsetSampler(Sampler): def __init__(self, indices): self.indices = indices def __iter__(self): return iter(self.indices) def __len__(self): return len(self.indices) class TestGroupedBatchSampler(unittest.TestCase): def test_respect_order_simple(self): drop_uneven = False dataset = [i for i in range(40)] group_ids = [i // 10 for i in dataset] sampler = SequentialSampler(dataset) for batch_size in [1, 3, 5, 6]: batch_sampler = GroupedBatchSampler( sampler, group_ids, batch_size, drop_uneven ) result = list(batch_sampler) merged_result = list(itertools.chain.from_iterable(result)) self.assertEqual(merged_result, dataset) def test_respect_order(self): drop_uneven = False dataset = [i for i in range(10)] group_ids = [0, 0, 1, 0, 1, 1, 0, 1, 1, 0] sampler = SequentialSampler(dataset) expected = [ [[0], [1], [2], [3], [4], [5], [6], [7], [8], [9]], [[0, 1, 3], [2, 4, 5], [6, 9], [7, 8]], [[0, 1, 3, 6], [2, 4, 5, 7], [8], [9]], ] for idx, batch_size in enumerate([1, 3, 4]): batch_sampler = GroupedBatchSampler( sampler, group_ids, batch_size, drop_uneven ) result = list(batch_sampler) self.assertEqual(result, expected[idx]) def test_respect_order_drop_uneven(self): batch_size = 3 drop_uneven = True dataset = [i for i in range(10)] group_ids = [0, 0, 1, 0, 1, 1, 0, 1, 1, 0] sampler = SequentialSampler(dataset) batch_sampler = GroupedBatchSampler(sampler, group_ids, batch_size, drop_uneven) result = list(batch_sampler) expected = [[0, 1, 3], [2, 4, 5]] self.assertEqual(result, expected) def test_subset_sampler(self): batch_size = 3 drop_uneven = False dataset = [i for i in range(10)] group_ids = [0, 0, 1, 0, 1, 1, 0, 1, 1, 0] sampler = SubsetSampler([0, 3, 5, 6, 7, 8]) batch_sampler = GroupedBatchSampler(sampler, group_ids, batch_size, drop_uneven) result = list(batch_sampler) expected = [[0, 3, 6], [5, 7, 8]] self.assertEqual(result, expected) def test_permute_subset_sampler(self): batch_size = 3 drop_uneven = False dataset = [i for i in range(10)] group_ids = [0, 0, 1, 0, 1, 1, 0, 1, 1, 0] sampler = SubsetSampler([5, 0, 6, 1, 3, 8]) batch_sampler = GroupedBatchSampler(sampler, group_ids, batch_size, drop_uneven) result = list(batch_sampler) expected = [[5, 8], [0, 6, 1], [3]] self.assertEqual(result, expected) def test_permute_subset_sampler_drop_uneven(self): batch_size = 3 drop_uneven = True dataset = [i for i in range(10)] group_ids = [0, 0, 1, 0, 1, 1, 0, 1, 1, 0] sampler = SubsetSampler([5, 0, 6, 1, 3, 8]) batch_sampler = GroupedBatchSampler(sampler, group_ids, batch_size, drop_uneven) result = list(batch_sampler) expected = [[0, 6, 1]] self.assertEqual(result, expected) def test_len(self): batch_size = 3 drop_uneven = True dataset = [i for i in range(10)] group_ids = [random.randint(0, 1) for _ in dataset] sampler = RandomSampler(dataset) batch_sampler = GroupedBatchSampler(sampler, group_ids, batch_size, drop_uneven) result = list(batch_sampler) self.assertEqual(len(result), len(batch_sampler)) self.assertEqual(len(result), len(batch_sampler)) batch_sampler = GroupedBatchSampler(sampler, group_ids, batch_size, drop_uneven) batch_sampler_len = len(batch_sampler) result = list(batch_sampler) self.assertEqual(len(result), batch_sampler_len) self.assertEqual(len(result), len(batch_sampler)) class TestIterationBasedBatchSampler(unittest.TestCase): def test_number_of_iters_and_elements(self): for batch_size in [2, 3, 4]: for num_iterations in [4, 10, 20]: for drop_last in [False, True]: dataset = [i for i in range(10)] sampler = SequentialSampler(dataset) batch_sampler = BatchSampler( sampler, batch_size, drop_last=drop_last ) iter_sampler = IterationBasedBatchSampler( batch_sampler, num_iterations ) assert len(iter_sampler) == num_iterations for i, batch in enumerate(iter_sampler): start = (i % len(batch_sampler)) * batch_size end = min(start + batch_size, len(dataset)) expected = [x for x in range(start, end)] self.assertEqual(batch, expected) if __name__ == "__main__": unittest.main()
PyTorch/Classification/ConvNets/se-resnext101-32x4d/training/TF32
TF32
DGXA100_se-resnext101-32x4d_TF32_90E
python ./multiproc.py --nproc_per_node 8 ./launch.py --model se-resnext101-32x4d --precision TF32 --mode convergence --platform DGXA100 /imagenet --epochs 90 --mixup 0.0 --workspace ${1:-./} --raport-file raport.json
Tools/PyTorch/TimeSeriesPredictionPlatform/conf
conf
deployment_config
# Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. defaults: - deployment: deploy checkpoint: ???
PyTorch/Recommendation/DLRM/preproc
preproc
split_dataset
# Copyright (c) 2021 NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import argparse import json import os import math from tqdm import tqdm import numpy as np from typing import Sequence # Workaround to avoid duplicating code from the main module, without building it outright. import sys sys.path.append('/workspace/dlrm') from dlrm.data.defaults import get_categorical_feature_type from dlrm.data.feature_spec import FeatureSpec def split_binary_file( binary_file_path: str, output_dir: str, categorical_feature_sizes: Sequence[int], num_numerical_features: int, batch_size: int, source_data_type: str = 'int32', ): record_width = 1 + num_numerical_features + len(categorical_feature_sizes) # label + numerical + categorical bytes_per_feature = np.__dict__[source_data_type]().nbytes bytes_per_entry = record_width * bytes_per_feature total_size = os.path.getsize(binary_file_path) batches_num = int(math.ceil((total_size // bytes_per_entry) / batch_size)) cat_feature_types = [get_categorical_feature_type(cat_size) for cat_size in categorical_feature_sizes] file_streams = [] try: input_data_f = open(binary_file_path, "rb") file_streams.append(input_data_f) numerical_f = open(os.path.join(output_dir, "numerical.bin"), "wb+") file_streams.append(numerical_f) label_f = open(os.path.join(output_dir, 'label.bin'), 'wb+') file_streams.append(label_f) categorical_fs = [] for i in range(len(categorical_feature_sizes)): fs = open(os.path.join(output_dir, f'cat_{i}.bin'), 'wb+') categorical_fs.append(fs) file_streams.append(fs) for _ in tqdm(range(batches_num)): raw_data = np.frombuffer(input_data_f.read(bytes_per_entry * batch_size), dtype=np.int32) batch_data = raw_data.reshape(-1, record_width) numerical_features = batch_data[:, 1:1 + num_numerical_features].view(dtype=np.float32) numerical_f.write(numerical_features.astype(np.float16).tobytes()) label = batch_data[:, 0] label_f.write(label.astype(bool).tobytes()) cat_offset = num_numerical_features + 1 for cat_idx, cat_feature_type in enumerate(cat_feature_types): cat_data = batch_data[:, (cat_idx + cat_offset):(cat_idx + cat_offset + 1)].astype(cat_feature_type) categorical_fs[cat_idx].write(cat_data.tobytes()) finally: for stream in file_streams: stream.close() def split_dataset(dataset_dir: str, output_dir: str, batch_size: int, numerical_features: int): categorical_sizes_file = os.path.join(dataset_dir, "model_size.json") with open(categorical_sizes_file) as f: # model_size.json contains the max value of each feature instead of the cardinality. # For feature spec this is changed for consistency and clarity. categorical_cardinalities = [int(v)+1 for v in json.load(f).values()] train_file = os.path.join(dataset_dir, "train_data.bin") test_file = os.path.join(dataset_dir, "test_data.bin") val_file = os.path.join(dataset_dir, "validation_data.bin") target_train = os.path.join(output_dir, "train") target_test = os.path.join(output_dir, "test") target_val = os.path.join(output_dir, "validation") os.makedirs(output_dir, exist_ok=True) os.makedirs(target_train, exist_ok=True) os.makedirs(target_test, exist_ok=True) os.makedirs(target_val, exist_ok=True) # VALIDATION chunk is ignored in feature spec on purpose feature_spec = FeatureSpec.get_default_feature_spec(number_of_numerical_features=numerical_features, categorical_feature_cardinalities=categorical_cardinalities) feature_spec.to_yaml(os.path.join(output_dir, 'feature_spec.yaml')) split_binary_file(test_file, target_test, categorical_cardinalities, numerical_features, batch_size) split_binary_file(train_file, target_train, categorical_cardinalities, numerical_features, batch_size) split_binary_file(val_file, target_val, categorical_cardinalities, numerical_features, batch_size) if __name__ == '__main__': parser = argparse.ArgumentParser() parser.add_argument('--dataset', type=str, required=True) parser.add_argument('--output', type=str, required=True) parser.add_argument('--batch_size', type=int, default=32768) parser.add_argument('--numerical_features', type=int, default=13) args = parser.parse_args() split_dataset( dataset_dir=args.dataset, output_dir=args.output, batch_size=args.batch_size, numerical_features=args.numerical_features )
PyTorch/Forecasting/TFT/triton/scripts/docker
docker
triton_inference_server
#!/usr/bin/env bash # Copyright (c) 2021-2022 NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # Install Docker . /etc/os-release && \ curl -fsSL https://download.docker.com/linux/debian/gpg | apt-key add - && \ echo "deb [arch=amd64] https://download.docker.com/linux/debian buster stable" > /etc/apt/sources.list.d/docker.list && \ curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey| apt-key add - && \ curl -s -L https://nvidia.github.io/nvidia-docker/$ID$VERSION_ID/nvidia-docker.list > /etc/apt/sources.list.d/nvidia-docker.list && \ apt-get update && \ apt-get install -y docker-ce docker-ce-cli containerd.io nvidia-docker2 WORKDIR="${WORKDIR:=$(pwd)}" export DATASETS_DIR=${WORKDIR}/datasets export WORKSPACE_DIR=${WORKDIR}/runner_workspace export CHECKPOINTS_DIR=${WORKSPACE_DIR}/checkpoints export MODEL_REPOSITORY_PATH=${WORKSPACE_DIR}/model_store export SHARED_DIR=${WORKSPACE_DIR}/shared_dir NVIDIA_VISIBLE_DEVICES=${NVIDIA_VISIBLE_DEVICES:=all} docker run --rm -d \ -p 8000:8000 \ -p 8001:8001 \ -p 8002:8002 \ --runtime=nvidia \ -e NVIDIA_VISIBLE_DEVICES=${NVIDIA_VISIBLE_DEVICES} \ -e ORT_TENSORRT_FP16_ENABLE=1 \ -v ${MODEL_REPOSITORY_PATH}:${MODEL_REPOSITORY_PATH} \ --shm-size=1g \ --ulimit memlock=-1 \ --ulimit stack=67108864 \ --ipc=host \ nvcr.io/nvidia/tritonserver:22.11-py3 tritonserver \ --model-store=${MODEL_REPOSITORY_PATH} \ --strict-model-config=false \ --exit-on-error=true \ --model-control-mode=explicit
PyTorch/LanguageModeling/BART
BART
pretrain
# Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== import argparse import glob import logging import os from tabnanny import check import time import datetime import random from collections import defaultdict from pathlib import Path from typing import Dict, List, Tuple import json import numpy as np import torch from torch.utils.data import DataLoader from torch.utils.tensorboard import SummaryWriter from training_base import BaseTransformer, add_generic_args, generic_train from bart.tokenization.tokenization_mbart import MBartTokenizer from bart.configuration.configuration_bart import BartConfig from bart.tokenization.tokenization_bart import BartTokenizer from bart.modeling.modeling_bart import BartForConditionalGeneration from utils.utils import ( PretrainingSeq2SeqDataset, Seq2SeqDataset, assert_all_frozen, freeze_params, get_git_info, label_smoothed_nll_loss, lmap, pickle_save, save_git_info, save_json, use_task_specific_params, format_step ) from utils.data_collator import DataCollatorForBART from utils.gpu_affinity import set_affinity from utils.distributed_utils import get_rank, get_device_count, get_world_size import dllogger import lddl.torch from lddl.utils import get_all_parquets_under logger = logging.getLogger(__name__) class BartForConditionalGenerationWrapper(torch.nn.Module): def __init__(self, model, args): super(BartForConditionalGenerationWrapper, self).__init__() if args.fp16: model.half() elif args.bf16: model.bfloat16() model.train() self.module = model def forward(self, input_ids, attention_mask, decoder_input_ids): outputs = self.module.forward(input_ids, attention_mask=attention_mask, decoder_input_ids=decoder_input_ids, use_cache=False) return outputs class PretrainingModule(BaseTransformer): mode = "pretraining" loss_names = ["loss"] def __init__(self, hparams, **kwargs): super().__init__(hparams, num_labels=None, mode=self.mode, **kwargs) use_task_specific_params(self.model, "pretraining") save_git_info(self.hparams.output_dir) self.metrics_save_path = Path(self.output_dir) / "metrics.json" self.hparams_save_path = Path(self.output_dir) / "hparams.pkl" pickle_save(self.hparams, self.hparams_save_path) self.step_count = 0 self.metrics = defaultdict(list) self.dataset_kwargs: dict = dict( max_source_length=self.hparams.max_source_length, prefix=self.model.config.prefix or "", ) self.n_obs = { "train": self.hparams.n_train if self.hparams.n_train >= 0 else None } #@todo should you freeze? if self.hparams.freeze_embeds: self.freeze_embeds() if self.hparams.freeze_encoder: freeze_params(self.model.get_encoder()) assert_all_frozen(self.model.get_encoder()) self.hparams.git_sha = get_git_info()["repo_sha"] self.num_workers = hparams.num_workers self.decoder_start_token_id = None # default to config if self.model.config.decoder_start_token_id is None and isinstance(self.tokenizer, MBartTokenizer): self.decoder_start_token_id = self.tokenizer.lang_code_to_id[hparams.tgt_lang] self.model.config.decoder_start_token_id = self.decoder_start_token_id self.collate_fn = DataCollatorForBART( tokenizer=self.tokenizer, mlm_probability=self.hparams.mlm_probability, permute_sentence_ratio=self.hparams.permute_sentence_ratio, decoder_start_token_id=self.model.config.decoder_start_token_id ) self.dataset_class = ( PretrainingSeq2SeqDataset ) self.conig = self.model.config def freeze_embeds(self): """Freeze token embeddings and positional embeddings for bart, just token embeddings for t5.""" try: freeze_params(self.model.model.shared) for d in [self.model.model.encoder, self.model.model.decoder]: freeze_params(d.embed_positions) freeze_params(d.embed_tokens) except AttributeError: freeze_params(self.model.shared) for d in [self.model.encoder, self.model.decoder]: freeze_params(d.embed_tokens) def forward(self, input_ids, **kwargs): return self.model(input_ids, **kwargs) def ids_to_clean_text(self, generated_ids: List[int]): gen_text = self.tokenizer.batch_decode( generated_ids, skip_special_tokens=True, clean_up_tokenization_spaces=True ) return lmap(str.strip, gen_text) def _step(self, batch: dict) -> Tuple: pad_token_id = self.tokenizer.pad_token_id src_ids, src_mask, decoder_input_ids = batch["input_ids"], batch["attention_mask"], batch["decoder_input_ids"] tgt_ids = batch["labels"] outputs = self(src_ids, attention_mask=src_mask, decoder_input_ids=decoder_input_ids, use_cache=False) lm_logits = outputs[0] if self.hparams.label_smoothing == 0: # Same behavior as modeling_bart.py, besides ignoring pad_token_id ce_loss_fct = torch.nn.CrossEntropyLoss(ignore_index=pad_token_id) #@should you ignore unmasked tokens? Check! assert lm_logits.shape[-1] == self.config.vocab_size loss = ce_loss_fct(lm_logits.view(-1, lm_logits.shape[-1]), tgt_ids.view(-1)) else: lprobs = torch.nn.functional.log_softmax(lm_logits, dim=-1) loss, nll_loss = label_smoothed_nll_loss( lprobs, tgt_ids, self.hparams.label_smoothing, ignore_index=pad_token_id ) return (loss,), lm_logits @property def pad(self) -> int: return self.tokenizer.pad_token_id def training_step(self, batch) -> Dict: loss_tensors, logits = self._step(batch) logs = {name: loss for name, loss in zip(self.loss_names, loss_tensors)} # tokens per batch logs["ip_tpb"] = batch["input_ids"].numel() logs["op_tpb"] = batch["labels"].numel() logs["tpb"] = batch["input_ids"].ne(self.pad).sum() + batch["labels"].ne(self.pad).sum() logs["bs"] = batch["input_ids"].shape[0] logs["src_pad_tok"] = batch["input_ids"].eq(self.pad).sum() logs["src_pad_frac"] = batch["input_ids"].eq(self.pad).float().mean() # TODO(SS): make a wandb summary metric for this # self.log("train_loss_ddp_avg", loss_tensors[0], on_step=True, prog_bar=True, logger=True, sync_dist=self.sync_dist) return {"loss": loss_tensors[0], "log": logs} # Can remove after pytorch lightning fix def training_epoch_end(self, outputs) -> None: return def save_metrics(self, latest_metrics, type_path) -> None: self.metrics[type_path].append(latest_metrics) save_json(self.metrics, self.metrics_save_path) def get_dataset(self, type_path, src_file, shuffle_buffer_size=1000, shuffle_buffer_warmup_factor=16, max_shards_per_node=1048576) -> Seq2SeqDataset: lddl_dataset_kwargs = { 'transform':lambda x:x, 'local_rank': get_rank(), 'shuffle_buffer_size': shuffle_buffer_size, 'shuffle_buffer_warmup_factor': shuffle_buffer_warmup_factor, 'base_seed': self.hparams.seed, 'max_shards_per_node': max_shards_per_node } n_obs = self.n_obs[type_path] dataset = self.dataset_class( get_all_parquets_under(src_file), self.tokenizer, n_obs=n_obs, type_path=type_path, **self.dataset_kwargs, **lddl_dataset_kwargs, ) return dataset def get_dataloader(self, type_path: str, batch_size: int, shuffle: bool = False) -> DataLoader: dataset = self.get_dataset(type_path, self.hparams.data_dir) dataloader_args = {"collate_fn":self.collate_fn} return DataLoader( dataset, batch_size=batch_size, collate_fn=self.collate_fn, shuffle=False, num_workers=self.num_workers, sampler=None, pin_memory=True ) def train_dataloader(self) -> DataLoader: dataloader = self.get_dataloader("train", batch_size=self.hparams.train_batch_size, shuffle=True) return dataloader @staticmethod def add_model_specific_args(parser, root_dir): BaseTransformer.add_model_specific_args(parser, root_dir) add_generic_args(parser, root_dir) parser.add_argument( "--max_source_length", default=1024, type=int, help="The maximum total input sequence length after tokenization. Sequences longer " "than this will be truncated, sequences shorter will be padded.", ) parser.add_argument("--load_model_weights_only", action="store_true", help="Only load model weights, ignoring other ckpt states. useful at the start of phase2 training") parser.add_argument("--freeze_encoder", action="store_true") parser.add_argument("--freeze_embeds", action="store_true") parser.add_argument("--logger_name", type=str, choices=["default", "wandb", "wandb_shared"], default="default") parser.add_argument("--n_train", type=int, default=-1, required=False, help="# examples. -1 means use all.") parser.add_argument("--buffer_size", type=int, default=128, required=False, help="Buffer size for shuffling dataset") parser.add_argument( "--task", type=str, default="pretraining", required=False, help="# examples. -1 means use all." ) parser.add_argument("--label_smoothing", type=float, default=0.0, required=False) parser.add_argument("--mlm_probability", type=float, default=0.3, required=False) parser.add_argument("--permute_sentence_ratio", type=float, default=1.0, required=False) parser.add_argument("--src_lang", type=str, default="", required=False) parser.add_argument("--tgt_lang", type=str, default="", required=False) parser.add_argument( "--early_stopping_patience", type=int, default=-1, required=False, help="-1 means never early stop. early_stopping_patience is measured in validation checks, not epochs. So val_check_interval will effect it.", ) parser.add_argument("--local_rank", type=int, default=os.getenv('LOCAL_RANK', 0), help="local_rank for distributed training on gpus") parser.add_argument('--json-summary', type=str, default="results/dllogger.json", help='If provided, the json summary will be written to' 'the specified file.') return parser def set_seed(args): random.seed(args.seed + get_rank()) np.random.seed(args.seed + get_rank()) torch.manual_seed(args.seed + get_rank()) def load_checkpoint(args, path, model, optimizer, scaler): checkpoint = torch.load(path, map_location=args.device) model.load_state_dict(checkpoint["model"]) if not args.load_model_weights_only: if 'optimizer' in checkpoint: optimizer.load_state_dict(checkpoint["optimizer"]) if 'scaler' in checkpoint: scaler.load_state_dict(checkpoint["scaler"]) def main(args, model=None) -> PretrainingModule: print(args) Path(args.output_dir).mkdir(parents=True, exist_ok=True) # Initializes the distributed backend which will take care of sychronizing nodes/GPUs torch.cuda.set_device(args.local_rank) device = torch.device("cuda", args.local_rank) torch.distributed.init_process_group(backend="nccl") args.device = device # Set GPU affinity if args.affinity != 'disabled': affinity = set_affinity( get_rank(), get_device_count(), args.affinity ) logger.warning(f'{get_rank()}: thread affinity: {affinity}') # Set seed set_seed(args) # Setup logging logging.basicConfig( format="%(asctime)s - %(levelname)s - %(name)s - %(message)s", datefmt="%m/%d/%Y %H:%M:%S", level=logging.INFO if get_rank() in [-1, 0] else logging.WARN, ) logger.warning( "Process global rank: %s, device: %s, distributed training: %s, 16-bits training: %s", get_rank(), device, bool(get_rank() != -1), (args.fp16 or args.bf16), ) if model is None: if "pretraining" in args.task: ### Define BART model # Config from "https://s3.amazonaws.com/models.huggingface.co/bert/facebook/bart-large-cnn/config.json # Vocab modified to 50265 to be consistent with facebook/bart-large default config = BartConfig(**json.load(open(args.config_path, "r"))) if args.fp16: config.dtype = torch.float16 elif args.bf16: config.dtype = torch.bfloat16 else: config.dtype = None config.pre_ln = args.pre_ln model = BartForConditionalGeneration(config=config) tokenizer = BartTokenizer.from_pretrained( 'facebook/bart-large') # Downloads vocab and merges file automatically trainer: PretrainingModule = PretrainingModule(args, model=model, config=config, tokenizer=tokenizer) else: raise ValueError("Only pretraining supported!") dataset = Path(args.data_dir).name trainer.model.to(device) # Set up optimizer and scheduler optimizer, scheduler = trainer.configure_optimizers() optimizer = optimizer[0] scheduler = scheduler[0]['scheduler'] scaler = torch.cuda.amp.GradScaler(enabled=args.fp16) checkpoints = list(sorted(glob.glob(os.path.join(args.output_dir, "_step*.ckpt"), recursive=True), key=lambda x:int(x.split("step")[1].split(".")[0]))) step = 0 if args.resume_from_checkpoint: if ".ckpt" in args.resume_from_checkpoint: checkpoint = args.resume_from_checkpoint else: if len(checkpoints) > 0: #No checkpoints available checkpoint = checkpoints[-1] args.resume_from_checkpoint = checkpoint else: args.resume_from_checkpoint = None checkpoint = None if checkpoint is None: logger.info("Pretraining from scratch") else: logger.info("Loading BART model checkpoint using %s", checkpoint) checkpoint_suffix = checkpoint.split("step")[-1].split(".")[0] step = int(checkpoint_suffix) + 1 load_checkpoint(args, checkpoint, trainer.model, optimizer, scaler) if args.load_model_weights_only: args.resume_from_checkpoint = None step = 0 if args.fp16 and args.allreduce_post_accumulation_half_precision: trainer.model.half() if args.bf16 and args.allreduce_post_accumulation_half_precision: trainer.model.bfloat16() # Distributed training (should be after apex fp16 initialization) if args.local_rank != -1: trainer.model = torch.nn.parallel.DistributedDataParallel( trainer.model, device_ids=[args.local_rank], output_device=args.local_rank, find_unused_parameters=True ) generic_train(args, trainer, optimizer, scheduler, scaler, checkpoints, step) pickle_save(trainer.hparams, trainer.output_dir / "hparams.pkl") return trainer if __name__ == "__main__": parser = argparse.ArgumentParser() parser = PretrainingModule.add_model_specific_args(parser, os.getcwd()) args = parser.parse_args() if get_rank() == 0: dllogger.init(backends=[dllogger.JSONStreamBackend(verbosity=dllogger.Verbosity.VERBOSE, filename=args.json_summary)]) main(args) dllogger.flush()
TensorFlow2/Classification/ConvNets/runtime
runtime
__init__
# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. from runtime.runner import Runner
TensorFlow/Segmentation/VNet/utils
utils
tf_export
# Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import glob import inspect import os import shutil import subprocess from argparse import Namespace from typing import List, Callable import tensorflow as tf from google.protobuf import text_format from tensorflow.core.framework import graph_pb2 from tensorflow.python.compiler.tensorrt import trt_convert as trt from tensorflow.python.framework import dtypes from tensorflow.python.framework import graph_io from tensorflow.python.platform import gfile from tensorflow.python.tools import optimize_for_inference_lib os.environ["TF_CPP_MIN_LOG_LEVEL"] = "3" def _compress(src_path: str, dst_path: str): """ Compress source path into destination path :param src_path: (str) Source path :param dst_path: (str) Destination path """ print('[*] Compressing...') shutil.make_archive(dst_path, 'zip', src_path) print('[*] Compressed the contents in: {}.zip'.format(dst_path)) def _print_input(func: Callable): """ Decorator printing function name and args :param func: (Callable) Decorated function :return: Wrapped call """ def wrapper(*args, **kwargs): """ Print the name and arguments of a function :param args: Named arguments :param kwargs: Keyword arguments :return: Original function call """ tf.logging.set_verbosity(tf.logging.ERROR) func_args = inspect.signature(func).bind(*args, **kwargs).arguments func_args_str = ''.join('\t{} = {!r}\n'.format(*item) for item in func_args.items()) print('[*] Running \'{}\' with arguments:'.format(func.__qualname__)) print(func_args_str[:-1]) return func(*args, **kwargs) return wrapper def _parse_placeholder_types(values: str): """ Extracts placeholder types from a comma separate list. :param values: (str) Placeholder types :return: (List) Placeholder types """ values = [int(value) for value in values.split(",")] return values if len(values) > 1 else values[0] def _optimize_checkpoint_for_inference(graph_path: str, input_names: List[str], output_names: List[str]): """ Removes Horovod and training related information from the graph :param graph_path: (str) Path to the graph.pbtxt file :param input_names: (str) Input node names :param output_names: (str) Output node names """ print('[*] Optimizing graph for inference ...') input_graph_def = graph_pb2.GraphDef() with gfile.Open(graph_path, "rb") as f: data = f.read() text_format.Merge(data.decode("utf-8"), input_graph_def) output_graph_def = optimize_for_inference_lib.optimize_for_inference( input_graph_def, input_names, output_names, _parse_placeholder_types(str(dtypes.float32.as_datatype_enum)), False) print('[*] Saving original graph in: {}'.format(graph_path + '.old')) shutil.move(graph_path, graph_path + '.old') print('[*] Writing down optimized graph ...') graph_io.write_graph(output_graph_def, os.path.dirname(graph_path), os.path.basename(graph_path)) @_print_input def to_savedmodel(input_shape: str, model_fn: Callable, checkpoint_dir: str, output_dir: str, input_names: List[str], output_names: List[str], use_amp: bool, use_xla: bool, compress: bool, params: Namespace): """ Export checkpoint to Tensorflow savedModel :param input_shape: (str) Input shape to the model in format [batch, height, width, channels] :param model_fn: (Callable) Estimator's model_fn :param checkpoint_dir: (str) Directory where checkpoints are stored :param output_dir: (str) Output directory for storage of the generated savedModel :param input_names: (List[str]) Input node names :param output_names: (List[str]) Output node names :param use_amp: (bool )Enable TF-AMP :param use_xla: (bool) Enable XLA :param compress: (bool) Compress output :param params: (Namespace) Namespace to be passed to model_fn """ assert os.path.exists(checkpoint_dir), 'Path not found: {}'.format(checkpoint_dir) assert input_shape is not None, 'Input shape must be provided' _optimize_checkpoint_for_inference(os.path.join(checkpoint_dir, 'graph.pbtxt'), input_names, output_names) try: ckpt_path = os.path.splitext([p for p in glob.iglob(os.path.join(checkpoint_dir, '*.index'))][0])[0] except IndexError: raise ValueError('Could not find checkpoint in directory: {}'.format(checkpoint_dir)) config_proto = tf.compat.v1.ConfigProto() config_proto.allow_soft_placement = True config_proto.log_device_placement = False config_proto.gpu_options.allow_growth = True config_proto.gpu_options.force_gpu_compatible = True if use_amp: os.environ["TF_ENABLE_AUTO_MIXED_PRECISION_GRAPH_REWRITE"] = "1" if use_xla: config_proto.graph_options.optimizer_options.global_jit_level = tf.compat.v1.OptimizerOptions.ON_1 run_config = tf.estimator.RunConfig( model_dir=None, tf_random_seed=None, save_summary_steps=1e9, # disabled save_checkpoints_steps=None, save_checkpoints_secs=None, session_config=config_proto, keep_checkpoint_max=None, keep_checkpoint_every_n_hours=1e9, # disabled log_step_count_steps=1e9, train_distribute=None, device_fn=None, protocol=None, eval_distribute=None, experimental_distribute=None ) estimator = tf.estimator.Estimator( model_fn=model_fn, model_dir=ckpt_path, config=run_config, params=params ) print('[*] Exporting the model ...') input_type = tf.float16 if use_amp else tf.float32 def get_serving_input_receiver_fn(): def serving_input_receiver_fn(): features = tf.placeholder(dtype=input_type, shape=input_shape, name='input_tensor') return tf.estimator.export.TensorServingInputReceiver(features=features, receiver_tensors=features) return serving_input_receiver_fn export_path = estimator.export_saved_model( export_dir_base=output_dir, serving_input_receiver_fn=get_serving_input_receiver_fn(), checkpoint_path=ckpt_path ) print('[*] Done! path: `%s`' % export_path.decode()) if compress: _compress(export_path.decode(), os.path.join(output_dir, 'saved_model')) @_print_input def to_tf_trt(savedmodel_dir: str, output_dir: str, precision: str, feed_dict_fn: Callable, num_runs: int, output_tensor_names: List[str], compress: bool): """ Export Tensorflow savedModel to TF-TRT :param savedmodel_dir: (str) Input directory containing a Tensorflow savedModel :param output_dir: (str) Output directory for storage of the generated TF-TRT exported model :param precision: (str) Desired precision of the network (FP32, FP16 or INT8) :param feed_dict_fn: (Callable) Input tensors for INT8 calibration. Model specific. :param num_runs: (int) Number of calibration runs. :param output_tensor_names: (List) Name of the output tensor for graph conversion. Model specific. :param compress: (bool) Compress output """ if savedmodel_dir is None or not os.path.exists(savedmodel_dir): raise FileNotFoundError('savedmodel_dir not found: {}'.format(savedmodel_dir)) if os.path.exists(output_dir): print('[*] Output dir \'{}\' is not empty. Cleaning up ...'.format(output_dir)) shutil.rmtree(output_dir) print('[*] Converting model...') converter = trt.TrtGraphConverter(input_saved_model_dir=savedmodel_dir, precision_mode=precision) converter.convert() if precision == 'INT8': print('[*] Running INT8 calibration ...') converter.calibrate(fetch_names=output_tensor_names, num_runs=num_runs, feed_dict_fn=feed_dict_fn) converter.save(output_dir) print('[*] Done! TF-TRT saved_model stored in: `%s`' % output_dir) if compress: _compress('tftrt_saved_model', output_dir) @_print_input def to_onnx(input_dir: str, output_dir: str, compress: bool): """ Convert Tensorflow savedModel to ONNX with tf2onnx :param input_dir: (str) Input directory with a Tensorflow savedModel :param output_dir: (str) Output directory where to store the ONNX version of the model :param compress: (bool) Compress output """ if not os.path.exists(output_dir): os.makedirs(output_dir) file_name = os.path.join(output_dir, 'model.onnx') print('[*] Converting model...') ret = subprocess.call(['python', '-m', 'tf2onnx.convert', '--saved-model', input_dir, '--output', file_name], stdout=open(os.devnull, 'w'), stderr=subprocess.STDOUT) if ret > 0: raise RuntimeError('tf2onnx.convert has failed with error: {}'.format(ret)) print('[*] Done! ONNX file stored in: %s' % file_name) if compress: _compress(output_dir, 'onnx_model')
PyTorch/LanguageModeling/BERT/triton/runner
runner
core
# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import pathlib from enum import Enum from typing import Any, Dict, List import yaml class CustomDumper(yaml.Dumper): """ Custom YAML dumper to avoid craeting aliases """ def ignore_aliases(self, data: Dict) -> bool: return True class Paths: """ Paths mapping inside Triton Container """ MODEL_REPOSITORY_PATH = "/mnt/triton-models" LIBRARIES_PATH = "/mnt/libs" class Framework(Enum): """ Supported frameworks """ TensorFlow1 = "TensorFlow1" TensorFlow2 = "TensorFlow2" PyTorch = "PyTorch" class Command: """Represents wrapper of raw string command""" def __init__(self, data: str): """ Store command data Args: data: string with bash commands to execute """ self._data = data def __str__(self) -> str: """ String object representation Returns: String """ return self._data class DataObject(object): """ Data object representation handling recursive transformation from object to dict """ READ_ONLY = set() def to_dict(self) -> Dict: """ Represent object as dictionary Returns: Dict """ data = dict() filtered_data = {key: value for key, value in self.__dict__.items() if key not in self.READ_ONLY} for key, value in filtered_data.items(): data[key] = self._convert_value(value) return data def _convert_value(self, value: Any) -> Any: """ Convert value based on its type Args: value: variable to convert Returns: Converted object """ if isinstance(value, DataObject): value = value.to_dict() elif isinstance(value, dict): value = self._from_dict(value) elif isinstance(value, list): value = self._from_list(value) elif isinstance(value, Enum): value = value.value elif isinstance(value, pathlib.Path): value = value.as_posix() return value def _from_dict(self, values: Dict) -> Any: """ Convert dictionary values Args: values: dictionary with values Returns: Any """ data = dict() for key, value in values.items(): data[key] = self._convert_value(value) return data def _from_list(self, values: List) -> Any: """ Convert list of values Args: values: list with values Returns: Any """ items = list() for value in values: item = self._convert_value(value) items.append(item) return items AVAILABLE_FRAMEWORKS = [f.value for f in Framework]
PyTorch/Translation/Transformer/fairseq/models
models
fairseq_incremental_decoder
# Copyright (c) 2017-present, Facebook, Inc. # All rights reserved. # # This source code is licensed under the license found in the LICENSE file in # the root directory of this source tree. An additional grant of patent rights # can be found in the PATENTS file in the same directory. import torch.nn as nn class FairseqIncrementalDecoder(nn.Module): """Base class for incremental decoders.""" def __init__(self): super().__init__() def forward(self, prev_output_tokens, encoder_out, incremental_state=None): raise NotImplementedError def reorder_incremental_state(self, incremental_state, new_order): """Reorder incremental state. This should be called when the order of the input has changed from the previous time step. A typical use case is beam search, where the input order changes between time steps based on the selection of beams. """ def apply_reorder_incremental_state(module): if module != self and hasattr(module, 'reorder_incremental_state'): module.reorder_incremental_state( incremental_state, new_order, ) self.apply(apply_reorder_incremental_state) def set_beam_size(self, beam_size): """Sets the beam size in the decoder and all children.""" if getattr(self, '_beam_size', -1) != beam_size: def apply_set_beam_size(module): if module != self and hasattr(module, 'set_beam_size'): module.set_beam_size(beam_size) self.apply(apply_set_beam_size) self._beam_size = beam_size
TensorFlow2/Recommendation/WideAndDeep/triton
triton
model
# Copyright (c) 2021-2022, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. from types import SimpleNamespace from typing import List import tensorflow as tf from data.outbrain.features import get_outbrain_feature_spec, EMBEDDING_DIMENSIONS from trainer.model.widedeep import wide_deep_model def update_argparser(parser): parser.add_argument('--deep-hidden-units', type=int, default=[1024, 1024, 1024, 1024, 1024], nargs='+', help='Hidden units per layer for deep model, separated by spaces') parser.add_argument('--deep-dropout', type=float, default=0.1, help='Dropout regularization for deep model') parser.add_argument('--combiner', type=str, default='sum', choices=['mean', 'sum'], help='Type of aggregation used for multi hot categorical features') parser.add_argument('--precision', type=str, default="fp16", choices=['fp32', 'fp16'], help='Precision of the ops. AMP will be used in case of fp16') parser.add_argument('--checkpoint-dir', type=str, required=True, help='Path to directory containing checkpoint') def get_model( *, deep_hidden_units: List[int], deep_dropout: float, combiner: str, checkpoint_dir: str, precision: str = "fp32", batch_size: int = 131072 ): args = { 'deep_hidden_units': deep_hidden_units, 'deep_dropout': deep_dropout, 'combiner': combiner } args = SimpleNamespace(**args) #This will be changed in the future when feature spec support for triton is added feature_spec = get_outbrain_feature_spec("") embedding_dimensions = EMBEDDING_DIMENSIONS model, features = wide_deep_model(args, feature_spec, embedding_dimensions) checkpoint = tf.train.Checkpoint(model=model) checkpoint.restore(tf.train.latest_checkpoint(checkpoint_dir)).expect_partial() inputs = features.values() outputs = model(features, training=False) model = tf.keras.Model(inputs=inputs, outputs=outputs) @tf.function def call_fn(*model_inputs): return model(model_inputs, training=False) return model, call_fn if __name__ == '__main__': get_model(deep_hidden_units=[1024, 1024, 1024, 1024, 1024], deep_dropout=0.1, combiner='sum', checkpoint_dir='/tmp/wd2/checkpoint')
PyTorch/Segmentation/MaskRCNN/pytorch/scripts/docker
docker
build
#!/bin/bash docker build --rm -t nvidia_joc_maskrcnn_pt . -f Dockerfile
PyTorch/Classification/ConvNets/se-resnext101-32x4d/training/FP32
FP32
DGX1V_se-resnext101-32x4d_FP32_90E
python ./multiproc.py --nproc_per_node 8 ./launch.py --model se-resnext101-32x4d --precision FP32 --mode convergence --platform DGX1V /imagenet --epochs 90 --mixup 0.0 --workspace ${1:-./} --raport-file raport.json
TensorFlow/Recommendation/WideAndDeep/utils/hooks
hooks
training_hooks
#! /usr/bin/python # -*- coding: utf-8 -*- # Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. class MeanAccumulator: def __init__(self): self.sum = 0 self.count = 0 def consume(self, value): self.sum += value self.count += 1 def value(self): return self.sum / self.count
Tools/PyTorch/TimeSeriesPredictionPlatform/triton/deployment_toolkit/model_analyzer
model_analyzer
model_analyzer
# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import logging import subprocess from subprocess import CalledProcessError from .exceptions import ModelAnalyzerException SERVER_OUTPUT_TIMEOUT_SECS = 5 LOGGER = logging.getLogger(__name__) class ModelAnalyzerMode: PROFILE = "profile" ANALYZE = "analyze" REPORT = "report" class ModelAnalyzerReportMode: OFFLINE = "offline" ONLINE = "online" class ModelAnalyzer: """ Concrete Implementation of Model Analyzer interface that runs analyzer locally as as subprocess. """ _analyzer_path = "model-analyzer" def __init__(self, config): """ Parameters ---------- config : AnalyzerConfig the config object containing arguments for this server instance """ self._analyzer_process = None self._analyzer_config = config self._log = None def run(self, mode: str, verbose: bool = False, quiet: bool = False, report_mode: str = None): """ Starts the model analyzer locally """ if self._analyzer_path: cmd = [self._analyzer_path] if verbose: cmd += ["--verbose"] if quiet: cmd += ["--quiet"] if report_mode: cmd += ["-m"] cmd += [report_mode] cmd += [mode] cmd += self._analyzer_config.to_cli_string().split() LOGGER.debug(f"Model Analyze command: {cmd}") try: subprocess.run(cmd, check=True, start_new_session=True) except CalledProcessError as e: raise ModelAnalyzerException( f"Running {self._analyzer_path} with {e.cmd} failed with" f" exit status {e.returncode} : {e.output}" )
TensorFlow2/LanguageModeling/ELECTRA/scripts
scripts
finetune_ckpts_on_squad
#!/usr/bin/env bash # Copyright (c) 2020 NVIDIA CORPORATION. All rights reserved. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. checkpoints=${checkpoints:-"results/base/checkpoints"} for folder in $checkpoints; do ckpts_dir=${folder} output_dir=${folder} for f in $ckpts_dir/*.index; do ckpt=${f%.*} echo "==================================== START $ckpt ====================================" python postprocess_pretrained_ckpt.py --pretrained_checkpoint=$ckpt --output_dir=$output_dir --amp bash scripts/run_squad.sh $output_dir/discriminator; echo "==================================== END $ckpt ===================================="; done done
PyTorch/Detection/Efficientdet/scripts/waymo
waymo
validation_AMP_8xA100-80G
#!/bin/bash NUM_PROC=$1 rm -rf *.json python -u -m bind_launch --nproc_per_node=${NUM_PROC} validate.py '/workspace/object_detection/datasets/waymo' --model efficientdet_d0 -b 10 --amp --waymo --use-ema --input_size 1536 --num_classes 3 --waymo-val /waymo/validation/images --waymo-val-annotation /waymo/validation/annotations/annotations.json --checkpoint /model/checkpoint.pth.tar --torchscript
PyTorch/Segmentation/MaskRCNN/pytorch/maskrcnn_benchmark/utils
utils
imports
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved. # Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved. import torch import importlib import importlib.util import sys # from https://stackoverflow.com/questions/67631/how-to-import-a-module-given-the-full-path?utm_medium=organic&utm_source=google_rich_qa&utm_campaign=google_rich_qa def import_file(module_name, file_path, make_importable=False): spec = importlib.util.spec_from_file_location(module_name, file_path) module = importlib.util.module_from_spec(spec) spec.loader.exec_module(module) if make_importable: sys.modules[module_name] = module return module
TensorFlow2/Recommendation/DLRM_and_DCNv2/dataloading
dataloading
defaults
# Copyright (c) 2021 NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. CATEGORICAL_CHANNEL = "categorical" NUMERICAL_CHANNEL = "numerical" LABEL_CHANNEL = "label" SPLIT_BINARY = "split_binary" TRAIN_MAPPING = "train" TEST_MAPPING = "test" DTYPE_SELECTOR = "dtype" CARDINALITY_SELECTOR = "cardinality"
Tools/PyTorch/TimeSeriesPredictionPlatform/conf/trainer/criterion
criterion
L1
# Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. _target_: torch.nn.L1Loss
PyTorch/LanguageModeling/Transformer-XL/pytorch/utils
utils
vocabulary
# Copyright (c) 2019-2020, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import contextlib import os from collections import Counter from collections import OrderedDict import torch import utils class Vocab(object): def __init__(self, special=[], min_freq=0, max_size=None, lower_case=True, delimiter=None, vocab_file=None): self.counter = Counter() self.special = special self.min_freq = min_freq self.max_size = max_size self.lower_case = lower_case self.delimiter = delimiter self.vocab_file = vocab_file def tokenize(self, line, add_eos=False, add_double_eos=False): line = line.strip() # convert to lower case if self.lower_case: line = line.lower() # empty delimiter '' will evaluate False if self.delimiter == '': symbols = line else: symbols = line.split(self.delimiter) if add_double_eos: # lm1b return ['<S>'] + symbols + ['<S>'] elif add_eos: return symbols + ['<eos>'] else: return symbols def count_file(self, path, verbose=False, add_eos=False): if verbose: print('counting file {} ...'.format(path)) assert os.path.exists(path) sents = [] with open(path, 'r', encoding='utf-8') as f: for idx, line in enumerate(f): if verbose and idx > 0 and idx % 500000 == 0: print(' line {}'.format(idx)) symbols = self.tokenize(line, add_eos=add_eos) self.counter.update(symbols) sents.append(symbols) return sents def count_sents(self, sents, verbose=False): """ sents : a list of sentences, each a list of tokenized symbols """ if verbose: print('counting {} sents ...'.format(len(sents))) for idx, symbols in enumerate(sents): if verbose and idx > 0 and idx % 500000 == 0: print(' line {}'.format(idx)) self.counter.update(symbols) def _build_from_file(self, vocab_file): self.idx2sym = [] self.sym2idx = OrderedDict() with open(vocab_file, 'r', encoding='utf-8') as f: for line in f: symb = line.strip().split()[0] self.add_symbol(symb) self.unk_idx = self.sym2idx['<UNK>'] def build_vocab(self): if self.vocab_file: print('building vocab from {}'.format(self.vocab_file)) self._build_from_file(self.vocab_file) print('final vocab size {}'.format(len(self))) else: print('building vocab with min_freq={}, max_size={}'.format( self.min_freq, self.max_size)) self.idx2sym = [] self.sym2idx = OrderedDict() for sym in self.special: self.add_special(sym) for sym, cnt in self.counter.most_common(self.max_size): if cnt < self.min_freq: break self.add_symbol(sym) print('final vocab size {} from {} unique tokens'.format( len(self), len(self.counter))) def encode_file(self, path, ordered=False, verbose=False, add_eos=True, add_double_eos=False): if verbose: print('encoding file {} ...'.format(path)) assert os.path.exists(path) encoded = [] with open(path, 'r', encoding='utf-8') as f: for idx, line in enumerate(f): if verbose and idx > 0 and idx % 500000 == 0: print(' line {}'.format(idx)) symbols = self.tokenize(line, add_eos=add_eos, add_double_eos=add_double_eos) encoded.append(self.convert_to_tensor(symbols)) if ordered: encoded = torch.cat(encoded) return encoded def encode_sents(self, sents, ordered=False, verbose=False): if verbose: print('encoding {} sents ...'.format(len(sents))) encoded = [] for idx, symbols in enumerate(sents): if verbose and idx > 0 and idx % 500000 == 0: print(' line {}'.format(idx)) encoded.append(self.convert_to_tensor(symbols)) if ordered: encoded = torch.cat(encoded) return encoded def add_special(self, sym): if sym not in self.sym2idx: self.idx2sym.append(sym) self.sym2idx[sym] = len(self.idx2sym) - 1 setattr(self, '{}_idx'.format(sym.strip('<>')), self.sym2idx[sym]) def add_symbol(self, sym): if sym not in self.sym2idx: self.idx2sym.append(sym) self.sym2idx[sym] = len(self.idx2sym) - 1 def get_sym(self, idx): assert 0 <= idx < len(self), 'Index {} out of range'.format(idx) return self.idx2sym[idx] def get_idx(self, sym): if sym in self.sym2idx: return self.sym2idx[sym] else: # print('encounter unk {}'.format(sym)) assert '<eos>' not in sym assert hasattr(self, 'unk_idx') return self.sym2idx.get(sym, self.unk_idx) def get_symbols(self, indices): return [self.get_sym(idx) for idx in indices] def get_indices(self, symbols): return [self.get_idx(sym) for sym in symbols] def convert_to_tensor(self, symbols): return torch.LongTensor(self.get_indices(symbols)) def convert_to_sent(self, indices, exclude=None): if exclude is None: return ' '.join([self.get_sym(idx) for idx in indices]) else: return ' '.join([self.get_sym(idx) for idx in indices if idx not in exclude]) def __len__(self): return len(self.idx2sym) # Class OpenAIVocab has been adapted from # https://github.com/cybertronai/transformer-xl/blob/master/utils/vocabulary.py class OpenAIVocab(Vocab): def __init__(self, max_size=None, vocab_file=None): from pytorch_transformers import GPT2Tokenizer self.tokenizer = GPT2Tokenizer.from_pretrained('gpt2') self.EOT = self.tokenizer.encoder['<|endoftext|>'] self.max_size = max_size self.vocab_file = vocab_file pad = 8 vocab_size = len(self.tokenizer) padded_vocab_size = (vocab_size + pad - 1) // pad * pad for i in range(0, padded_vocab_size - vocab_size): token = f'madeupword{i:09d}' self.tokenizer.add_tokens([token]) def __len__(self): return len(self.tokenizer) def count_file(self, path, verbose=False, add_eos=False): # TODO: train from scratch, respect self.max_size pass def build_vocab(self): pass def encode_file(self, path, ordered=False, verbose=False, add_eos=True, add_double_eos=False) -> torch.LongTensor: cached = path + '.bpe' if os.path.exists(cached): return torch.load(cached) print(f'encoding file {path} ...') assert os.path.exists(path), f"{path} doesn't exist" with open(path, encoding='utf-8') as f: # Suppress warnings about length. with open(os.devnull, "w") as devnull, contextlib.redirect_stderr(devnull): out = torch.LongTensor(self.tokenizer.encode(f.read()) + [self.EOT]) with utils.distributed.sync_workers() as rank: if rank == 0: torch.save(out, cached) return out def tokenize(self, line, add_eos=False, add_double_eos=False): return self.tokenizer.encode(line) def convert_to_tensor(self, symbols): return torch.LongTensor(symbols)
PyTorch/Recommendation/DLRM/dlrm/cuda_src/dot_based_interact
dot_based_interact
dot_based_interact_tf32_fwd
#include <cuda.h> #include <cuda_fp16.h> #include <cuda_runtime_api.h> #include <device_launch_parameters.h> #include <mma.h> #include <cuda_fp16.hpp> #include <math.h> #include <fstream> #include <iomanip> #include <iostream> #include <vector> #include <ATen/cuda/CUDAContext.h> #include <torch/extension.h> #include "shared_utils.cuh" using namespace nvcuda; using namespace nvcuda; template <uint WARPS_PER_BLOCK, uint THREADBLOCK_SIZE, uint M_BLOCKS, uint K_BLOCKS, uint SMEM_STRIDE, uint SMEM_STRIDE_ACC, uint WARP_SIZE, uint WARP_SIZE_LOG_2, uint TILE_DIM, uint TILE_DIM_LOG_2> __launch_bounds__(THREADBLOCK_SIZE) __global__ void dotBasedInteractTF32FwdKernelNonAligned_(const __half *__restrict input, __half *__restrict output, uint batch_size, uint num_rows, uint num_cols, uint num_rows_after_padding, uint num_cols_after_padding, uint smem_elems_per_warp, uint smem_rows_per_warp, uint output_size, uint num_row_steps, uint num_col_steps, uint padding_size) { uint warp_id = (threadIdx.x >> WARP_SIZE_LOG_2); //each threadblock covers multiple samples int sample_id = blockIdx.x * WARPS_PER_BLOCK + warp_id; //each warp covers one sample if (sample_id >= batch_size) { return; } int lane_id = threadIdx.x & (WARP_SIZE - 1); //0...32 within a sample extern __shared__ half shmem_dynamic_[]; half *shmem = shmem_dynamic_ + (warp_id * smem_elems_per_warp); //skip to the input for our warp const half *sample_input = input + num_rows * num_cols * sample_id; //copy all rows of our sample into shmem for (uint i = 0; i < num_rows; ++i, sample_input += num_cols) { for (uint idx = lane_id; idx < num_cols; idx += WARP_SIZE) { (shmem + i * SMEM_STRIDE)[idx] = sample_input[idx]; } } uint idx = lane_id + num_cols; //pad each row (embedding) to num_cols_after_padding //this assumes that num_cols_after_padding-num_cols<=WARP_SIZE if (idx < num_cols_after_padding) { for (int i = 0; i < num_rows; ++i) { (shmem + i * SMEM_STRIDE)[idx] = __float2half(0); } } //add more zero-filled rows (embeddings) to pad to tile width //zero out 4 cells at once, hence the >>2 half4 zeros; zeros.vals[0].x = __float2half(0); zeros.vals[0].y = __float2half(0); zeros.vals[1].x = __float2half(0); zeros.vals[1].y = __float2half(0); if (lane_id < (num_cols_after_padding >> 2)) { for (int i = num_rows; i < num_rows_after_padding; i++) { ((half4 *)(shmem + i * SMEM_STRIDE))[lane_id] = zeros; } } __syncwarp(); half *gmem_output = output + output_size * sample_id; //copy over the bottom_mlp_output into the final result //assumes bottom_mlp_output is at the start of the input for (uint idx = lane_id; idx < num_cols; idx += WARP_SIZE) { gmem_output[idx] = shmem[idx]; } //compute the dot product wmma::fragment<wmma::accumulator, TILE_DIM, TILE_DIM, TILE_DIM, float> acc[M_BLOCKS][M_BLOCKS]; for (int i = 0; i < M_BLOCKS; i++) { for (int j = 0; j < M_BLOCKS; j++) { wmma::fill_fragment(acc[i][j], 0); } } for (int k_step = 0; k_step < num_col_steps; k_step++) { wmma::fragment<wmma::matrix_a, TILE_DIM, TILE_DIM, TILE_DIM, half, wmma::row_major> a[M_BLOCKS]; wmma::fragment<wmma::matrix_b, TILE_DIM, TILE_DIM, TILE_DIM, half, wmma::col_major> b[M_BLOCKS]; for (int j = 0; j < M_BLOCKS; j++) { int base_row = (j < M_BLOCKS - 1) ? j * 16 : smem_rows_per_warp - 16; const half *tile_ptr = shmem + (base_row * SMEM_STRIDE + k_step * 16); wmma::load_matrix_sync(a[j], tile_ptr, SMEM_STRIDE); wmma::load_matrix_sync(b[j], tile_ptr, SMEM_STRIDE); } for (int i = 0; i < M_BLOCKS; i++) { for (int j = 0; j < M_BLOCKS; j++) { wmma::mma_sync(acc[i][j], a[i], b[j], acc[i][j]); } } } float *shmem_store = reinterpret_cast<float *>(shmem); for (int i = 0; i < M_BLOCKS; i++) { for (int j = 0; j < M_BLOCKS; j++) { float *tile_ptr = shmem_store + (i * 16 * SMEM_STRIDE_ACC + j * 16); wmma::store_matrix_sync(tile_ptr, acc[i][j], SMEM_STRIDE_ACC, wmma::mem_row_major); } } // skip over the part where we copied the bottom_mlp_output half *gmem_interact_output = gmem_output + num_cols; // copy over the dot product result into the output int lastRowBlockOffset = M_BLOCKS * 16 - smem_rows_per_warp; int srcLine = 0; for (int i = 0; i < num_rows; ++i, ++srcLine) { if (i == ((M_BLOCKS - 1) * 16)) { srcLine += lastRowBlockOffset; } if (lane_id < i) { //this assumes we have num_categorical_features<WARP_SIZE uint offset = (i * (i - 1)) >> 1; gmem_interact_output[offset + lane_id] = __float2half(shmem_store[srcLine * SMEM_STRIDE_ACC + lane_id]); } } // Add padding to the output vectors if (lane_id < padding_size) { gmem_output[output_size - lane_id - 1] = __float2half(0); } } template <uint WARPS_PER_BLOCK, uint THREADBLOCK_SIZE, uint WARP_SIZE, uint WARP_SIZE_LOG_2, uint TILE_LENGTH, uint TILE_LENGTH_LOG_2, uint TILE_WIDTH, uint TILE_WIDTH_LOG_2, uint ROW_TILES_PER_STEP> __launch_bounds__(THREADBLOCK_SIZE) __global__ void dotBasedInteractTF32FwdKernel(const float *__restrict input, float *__restrict output, uint batch_size, uint num_rows, uint num_cols, uint num_rows_after_padding, uint num_cols_after_padding, uint smem_elems_per_warp, uint output_size, uint num_row_steps, uint num_col_steps, uint smem_stride, uint smem_stride_acc, uint padding_size) { // The only support sizes for TF32. const uint kWmmaM = 16; const uint kWmmaN = 16; const uint kWmmaK = 8; uint warp_id = threadIdx.x >> WARP_SIZE_LOG_2; //each threadblock covers multiple samples uint sample_id = blockIdx.x * WARPS_PER_BLOCK + warp_id; //each warp covers a single sample if (sample_id >= batch_size) { return; } int lane_id = threadIdx.x & (WARP_SIZE - 1); //0...32 within a sample extern __shared__ float shmem_dynamic_float[]; float *shmem = shmem_dynamic_float + (warp_id * smem_elems_per_warp); const float *gmem_input = input + num_rows * num_cols * sample_id; //jump to our input sample //loop over embeddings, and copy each into shmem (but assume size is <=128) //convert to tf32 while copying if (lane_id < (num_cols >> 2)) { for (int i = 0; i < num_rows; ++i, gmem_input += num_cols) { float4 tmp = ((float4 *)gmem_input)[lane_id]; tmp.x = wmma::__float_to_tf32(tmp.x); tmp.y = wmma::__float_to_tf32(tmp.y); tmp.z = wmma::__float_to_tf32(tmp.z); tmp.w = wmma::__float_to_tf32(tmp.w); ((float4 *)(shmem + i * smem_stride))[lane_id] = tmp; } } float zero = wmma::__float_to_tf32(0.0f); float4 zero4; zero4.x = zero; zero4.y = zero; zero4.z = zero; zero4.w = zero; //pad each embedding to num_cols_after_padding //this assumes that num_cols_after_padding-num_cols<= WARP_SIZE uint idx = lane_id + num_cols; if (idx < num_cols_after_padding) { for (uint i = 0; i < num_rows; ++i) { (shmem + i * smem_stride)[idx] = zero; } } //add more fake embeddings filled with zeros so we can better use cores //zero out 4 cells at once, hence the >>2 if (lane_id < (num_cols_after_padding >> 2)) { for (int i = num_rows; i < num_rows_after_padding; i++) { ((float4 *)(shmem + i * smem_stride))[lane_id] = zero4; } } __syncwarp(); // TODO: MTMD - Copy directly without using shared memory //copy over bottom_mlp_output into the output array float *gmem_output = output + output_size * sample_id; if (lane_id < (num_cols >> 2)) { ((float4 *)gmem_output)[lane_id] = ((float4 *)shmem)[lane_id]; } //compute the dot product wmma::fragment<wmma::accumulator, kWmmaM, kWmmaN, kWmmaK, float> acc[ROW_TILES_PER_STEP][ROW_TILES_PER_STEP]; for (int i = 0; i < ROW_TILES_PER_STEP; i++) { for (int j = 0; j < ROW_TILES_PER_STEP; j++) { wmma::fill_fragment(acc[i][j], zero); } } // TODO: MTMD - Loop promotion for (int k_step = 0; k_step < num_col_steps; k_step++) { wmma::fragment<wmma::matrix_a, kWmmaM, kWmmaN, kWmmaK, wmma::precision::tf32, wmma::row_major> a[ROW_TILES_PER_STEP]; wmma::fragment<wmma::matrix_b, kWmmaM, kWmmaN, kWmmaK, wmma::precision::tf32, wmma::col_major> b[ROW_TILES_PER_STEP]; for (int j = 0; j < ROW_TILES_PER_STEP; j++) { int base_row = (j < ROW_TILES_PER_STEP - 1) ? j * 16 : num_rows_after_padding - 16; const float *tile_ptr = shmem + (base_row * smem_stride + k_step * kWmmaK); wmma::load_matrix_sync(a[j], tile_ptr, smem_stride); wmma::load_matrix_sync(b[j], tile_ptr, smem_stride); } for (int i = 0; i < ROW_TILES_PER_STEP; i++) { for (int j = 0; j < ROW_TILES_PER_STEP; j++) { wmma::mma_sync(acc[i][j], a[i], b[j], acc[i][j]); } } } for (int i = 0; i < ROW_TILES_PER_STEP; i++) { for (int j = 0; j < ROW_TILES_PER_STEP; j++) { float *tile_ptr = shmem + (i * kWmmaM * smem_stride_acc + j * kWmmaN); wmma::store_matrix_sync(tile_ptr, acc[i][j], smem_stride_acc, wmma::mem_row_major); } } // skip over the part where we copied the bottom_mlp_output float *gmem_interact_output = gmem_output + num_cols; // copy over the dot product result into the output int lastRowBlockOffset = ROW_TILES_PER_STEP * 16 - num_rows_after_padding; int src_line = 0; for (int i = 0; i < num_rows; ++i, ++src_line) { if (i == ((ROW_TILES_PER_STEP - 1) * 16)) { src_line += lastRowBlockOffset; } if (lane_id < i) { //this assumes we have num_categorical_features (num_rows-1)<WARP_SIZE uint offset = (i * (i - 1)) >> 1; gmem_interact_output[offset + lane_id] = shmem[src_line * smem_stride_acc + lane_id]; } } // Add padding to the output vectors if (lane_id < padding_size) { gmem_output[output_size - lane_id - 1] = zero; } } inline void dotBasedInteractTF32Fwd( const void *input, const void *bottom_mlp_output, void *output, uint batch_size, uint num_rows, uint num_cols) { const uint kWarpSize = 32; const uint kWarpSizeLog2 = Log2<kWarpSize>::value; const uint kTileLength = 16; const uint kTileLengthLog2 = Log2<kTileLength>::value; const uint kTileWidth = 8; const uint kTileWidthLog2 = Log2<kTileWidth>::value; const uint kWarpsPerBlock = 2; const uint kThreadBlockSize = kWarpsPerBlock * kWarpSize; const uint kRowTilesPerStep = 2; const uint kColTilesPerStep = 1; const uint kSkewFloat = 4; // Ensures we are 16 byte align as required by nvcuda::wmma::load_matrix_sync // num tiles uint mat_a_num_row_tiles = (num_rows + kTileLength - 1) >> kTileLengthLog2; uint mat_a_num_col_tiles = (num_cols + kTileWidth - 1) >> kTileWidthLog2; const uint &mat_b_num_row_tiles = mat_a_num_col_tiles; const uint &mat_b_num_col_tiles = mat_a_num_row_tiles; // number of rows and columns after padding uint num_rows_after_padding = mat_a_num_row_tiles << kTileLengthLog2; uint num_cols_after_padding = mat_a_num_col_tiles << kTileWidthLog2; uint num_row_steps = mat_a_num_row_tiles / kRowTilesPerStep; uint num_col_steps = mat_a_num_col_tiles / kColTilesPerStep; const uint smem_stride = num_cols_after_padding + kSkewFloat; const uint smem_elems_per_warp_mat = num_rows_after_padding * smem_stride; const uint smem_stride_acc = num_rows_after_padding + kSkewFloat; const uint smem_elems_per_warp_acc = num_rows_after_padding * smem_stride_acc; const uint smem_elems_per_warp = smem_elems_per_warp_mat > smem_elems_per_warp_acc ? smem_elems_per_warp_mat : smem_elems_per_warp_acc; uint raw_output_size = num_cols + ((num_rows * (num_rows - 1)) >> 1); uint output_size = ((raw_output_size-1)/8 + 1)*8; //round up to multiple of 8 uint padding_size = output_size-raw_output_size; bool float4_predicate = !((num_cols & 7) || (output_size & 7)); // TODO: MTMD - Clean Up // std::cout << "mat_a_num_row_tiles " << mat_a_num_row_tiles << std::endl; // std::cout << "mat_a_num_col_tiles " << mat_a_num_col_tiles << std::endl; // std::cout << "mat_b_num_row_tiles " << mat_b_num_row_tiles << std::endl; // std::cout << "mat_b_num_col_tiles " << mat_b_num_col_tiles << std::endl; // std::cout << "num_rows_after_padding " << num_rows_after_padding << std::endl; // std::cout << "num_cols_after_padding " << num_cols_after_padding << std::endl; // std::cout << "num_row_steps " << num_row_steps << std::endl; // std::cout << "num_col_steps " << num_col_steps << std::endl; // std::cout << "smem_stride " << smem_stride << std::endl; // std::cout << "smem_elems_per_warp_mat" << smem_elems_per_warp_mat << std::endl; // std::cout << "smem_stride_acc " << smem_stride_acc << std::endl; // std::cout << "smem_elems_per_warp_acc" << smem_elems_per_warp_acc << std::endl; // std::cout << "===================================================================" << std::endl; if (float4_predicate) { dotBasedInteractTF32FwdKernel<kWarpsPerBlock, kThreadBlockSize, kWarpSize, kWarpSizeLog2, kTileLength, kTileLengthLog2, kTileWidth, kTileWidthLog2, kRowTilesPerStep> <<<(batch_size + kWarpsPerBlock - 1) / kWarpsPerBlock, kThreadBlockSize, kWarpsPerBlock * smem_elems_per_warp * sizeof(float), at::cuda::getCurrentCUDAStream()>>>((const float *)input, (float *)output, batch_size, num_rows, num_cols, num_rows_after_padding, num_cols_after_padding, smem_elems_per_warp, output_size, num_row_steps, num_col_steps, smem_stride, smem_stride_acc, padding_size); } else { std::cout << "GENERIC VERSION IS UNFINISHED." << std::endl; #ifdef GENERIC_IS_DONE dotBasedInteractTF32FwdKernelNonAligned<warps_per_threadblock, threadblock_size, M_BLOCKS, K_BLOCKS, SMEM_STRIDE, SMEM_STRIDE_ACC, kWarpSize, kWarpSizeLog2, kTileDim, kTileDimLog2> <<<(batch_size + warps_per_threadblock - 1) / warps_per_threadblock, threadblock_size, warps_per_threadblock * smem_elems_per_warp * sizeof(__half), at::cuda::getCurrentCUDAStream()>>>((const __half *)input, (half *)output, batch_size, num_rows, num_cols, num_rows_after_padding, num_cols_after_padding, smem_elems_per_warp, smem_rows_per_warp, output_size, num_row_steps, num_col_steps, padding_size); #endif } }
Kaldi/SpeechRecognition/kaldi-asr-client
kaldi-asr-client
asr_client_imp
// Copyright (c) 2020-2021, NVIDIA CORPORATION. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. #include <grpc_client.h> #include <queue> #include <string> #include <unordered_map> #include <vector> #ifndef TRITON_KALDI_ASR_CLIENT_H_ #define TRITON_KALDI_ASR_CLIENT_H_ namespace ni = nvidia::inferenceserver; namespace nic = nvidia::inferenceserver::client; // time with arbitrary reference double inline gettime_monotonic() { struct timespec ts; clock_gettime(CLOCK_MONOTONIC, &ts); double time = ts.tv_sec; time += (double)(ts.tv_nsec) / 1e9; return time; } class TritonASRClient { struct TritonClient { std::unique_ptr<nic::InferenceServerGrpcClient> triton_client; }; std::string url_; std::string model_name_; std::vector<TritonClient> clients_; int nclients_; std::vector<uint8_t> chunk_buf_; std::vector<int64_t> shape_; int max_chunk_byte_size_; std::atomic<int> n_in_flight_; double started_at_; double total_audio_; bool print_results_; bool print_partial_results_; bool ctm_; std::mutex stdout_m_; int samps_per_chunk_; float samp_freq_; struct Result { std::string raw_lattice; double latency; }; std::unordered_map<uint64_t, double> start_timestamps_; std::mutex start_timestamps_m_; std::unordered_map<uint64_t, Result> results_; std::mutex results_m_; public: TritonASRClient(const std::string& url, const std::string& model_name, const int ncontextes, bool print_results, bool print_partial_results, bool ctm, float samp_freq); void CreateClientContext(); void SendChunk(uint64_t corr_id, bool start_of_sequence, bool end_of_sequence, float* chunk, int chunk_byte_size, uint64_t index); void WaitForCallbacks(); void PrintStats(bool print_latency_stats, bool print_throughput); void WriteLatticesToFile( const std::string& clat_wspecifier, const std::unordered_map<uint64_t, std::string>& corr_id_and_keys); }; #endif // TRITON_KALDI_ASR_CLIENT_H_
PyTorch/Recommendation/DLRM/dlrm/cuda_src/dot_based_interact
dot_based_interact
dot_based_interact_fp16_bwd
#include <cuda.h> #include <cuda_fp16.h> #include <cuda_runtime_api.h> #include <device_launch_parameters.h> #include <mma.h> #include <cuda_fp16.hpp> #include <fstream> #include <iomanip> #include <iostream> #include <vector> #include <ATen/cuda/CUDAContext.h> #include <torch/extension.h> #include "shared_utils.cuh" using namespace nvcuda; template <uint WARPS_PER_BLOCK, uint THREADBLOCK_SIZE, uint ROW_TILES_PER_STEP, uint COL_TILES_PER_STEP, uint WARP_SIZE, uint WARP_SIZE_LOG_2, uint TILE_DIM, uint TILE_DIM_LOG_2> __launch_bounds__(THREADBLOCK_SIZE) __global__ void dotBasedInteractBwdKernelNonAligned(const __half *__restrict input, const __half *__restrict upstream_grad, half __restrict *grad, half __restrict *bottom_mlp_grad, uint batch_size, uint num_rows, uint num_cols, uint num_rows_after_padding, uint num_cols_after_padding, uint sample_size, uint interaction_ugrad_size, uint interaction_ugrad_size_with_padding, uint interaction_ugrad_2D_size_elems, uint interaction_ugrad_2D_stride, uint input_size_elems, uint input_stride, uint num_row_steps, uint num_col_steps, uint row_tiles_per_step, uint shared_mem_per_warp_size_byte) { extern __shared__ half shared_mem[]; uint warp_id = (threadIdx.x >> WARP_SIZE_LOG_2); uint sample_id = blockIdx.x * WARPS_PER_BLOCK + warp_id; if (sample_id >= batch_size) { return; } uint lane_id = threadIdx.x & (WARP_SIZE - 1); // ">> 1" to convert to half pointer uint smem_warp_offset = warp_id * (shared_mem_per_warp_size_byte >> 1); half *smem_in = &shared_mem[smem_warp_offset]; half *smem_temp = &shared_mem[smem_warp_offset + input_size_elems]; float *smem_out = reinterpret_cast<float *>(smem_temp); // Global memory pointers for the current sample // Input uint gmem_input_sample_offset = sample_id * sample_size; const half *gmem_input = &input[gmem_input_sample_offset]; // Interaction Gradient const uint &gmem_grad_sample_offset = gmem_input_sample_offset; half *gmem_grad = &grad[gmem_grad_sample_offset]; // Bottom MLP gradient half *gmem_mlp_grad = &bottom_mlp_grad[sample_id * num_cols]; // Upstream gradient vector uint gmem_ugrad_sample_offset = sample_id * (num_cols + interaction_ugrad_size_with_padding); const half *gmem_ugrad = &upstream_grad[gmem_ugrad_sample_offset]; // Upstream gradient vector for interactions const half *gmem_ugrad_interactions = &gmem_ugrad[num_cols]; // upstream grad -> shared memory (place in input section temporarily) #pragma unroll for (uint idx = lane_id; idx < interaction_ugrad_size; idx += WARP_SIZE) { smem_in[idx] = gmem_ugrad_interactions[idx]; } __syncwarp(); // Form the 2D ugrad matrix. if (lane_id < num_rows_after_padding) { uint ugrad_flat_index = ((lane_id * (lane_id - 1)) >> 1); uint ugrad_offset_1 = lane_id * interaction_ugrad_2D_stride; for (uint row = 0; row < num_rows; row++) { half ugrad_val = __float2half(0.0f); if (row < lane_id && lane_id < num_rows) { ugrad_val = smem_in[ugrad_flat_index + row]; smem_temp[ugrad_offset_1 + row] = ugrad_val; } if (row <= lane_id && lane_id < num_rows_after_padding) { smem_temp[row * interaction_ugrad_2D_stride + lane_id] = ugrad_val; } } for (uint row = num_rows; row < num_rows_after_padding; row++) { smem_temp[row * interaction_ugrad_2D_stride + lane_id] = __float2half(0.0f); } } __syncwarp(); // Input -> Shared Memory for (uint row = 0; row < num_rows; row++) { half *smem_row_ptr = &smem_in[row * input_stride]; const half *gmem_row_ptr = &gmem_input[row * num_cols]; for (uint idx = lane_id; idx < num_cols; idx += WARP_SIZE) { smem_row_ptr[idx] = gmem_row_ptr[idx]; } uint idx = lane_id + num_cols; if (idx < num_cols_after_padding) { smem_row_ptr[idx] = __float2half(0); } } #pragma unroll 2 for (uint row = num_rows; row < num_rows_after_padding; row++) { half *smem_row_ptr = &smem_in[row * input_stride]; for (uint idx = lane_id; idx < num_cols_after_padding; idx += WARP_SIZE) { smem_row_ptr[idx] = __float2half(0); } } __syncwarp(); wmma::fragment<wmma::matrix_a, TILE_DIM, TILE_DIM, TILE_DIM, half, wmma::row_major> a[ROW_TILES_PER_STEP] [ROW_TILES_PER_STEP]; for (uint i = 0; i < ROW_TILES_PER_STEP; i++) { for (uint j = 0; j < ROW_TILES_PER_STEP; j++) { const half *tile_ptr = smem_temp + ((i * interaction_ugrad_2D_stride + j) << TILE_DIM_LOG_2); wmma::load_matrix_sync(a[i][j], tile_ptr, interaction_ugrad_2D_stride); } } wmma::fragment<wmma::accumulator, TILE_DIM, TILE_DIM, TILE_DIM, float> acc[ROW_TILES_PER_STEP]; wmma::fragment<wmma::matrix_b, TILE_DIM, TILE_DIM, TILE_DIM, half, wmma::row_major> b[ROW_TILES_PER_STEP]; for (int col_step = 0; col_step < num_col_steps; col_step++) { for (uint i = 0; i < ROW_TILES_PER_STEP; i++) { const half *tile_ptr = smem_in + ((i * input_stride + col_step) << TILE_DIM_LOG_2); wmma::fill_fragment(acc[i], 0); wmma::load_matrix_sync(b[i], tile_ptr, input_stride); } for (uint i = 0; i < ROW_TILES_PER_STEP; i++) { for (uint j = 0; j < ROW_TILES_PER_STEP; j++) { wmma::mma_sync(acc[i], a[i][j], b[j], acc[i]); } } for (uint i = 0; i < ROW_TILES_PER_STEP; i++) { float *tile_ptr = smem_out + i * TILE_DIM * TILE_DIM; wmma::store_matrix_sync(tile_ptr, acc[i], TILE_DIM, wmma::mem_row_major); } __syncwarp(); uint gmem_grad_col = (col_step << TILE_DIM_LOG_2) + lane_id; if (gmem_grad_col < num_cols) { for (uint i = 0; i < num_rows; i++) { gmem_grad[i * num_cols + gmem_grad_col] = __float2half(smem_out[(i << TILE_DIM_LOG_2) + lane_id]); } } } for (uint idx = lane_id; idx < num_cols; idx += WARP_SIZE) { gmem_mlp_grad[idx] = gmem_ugrad[idx]; } } template <uint WARPS_PER_BLOCK, uint THREADBLOCK_SIZE, uint ROW_TILES_PER_STEP, uint COL_TILES_PER_STEP, uint WARP_SIZE, uint WARP_SIZE_LOG_2, uint TILE_DIM, uint TILE_DIM_LOG_2> __launch_bounds__(THREADBLOCK_SIZE) __global__ void dotBasedInteractBwdKernel(const __half *__restrict input, const __half *__restrict upstream_grad, half __restrict *grad, half __restrict *bottom_mlp_grad, uint batch_size, uint num_rows, uint num_cols, uint num_rows_after_padding, uint num_cols_after_padding, uint sample_size, uint interaction_ugrad_size, uint interaction_ugrad_size_with_padding, uint interaction_ugrad_2D_size_elems, uint interaction_ugrad_2D_stride, uint input_size_elems, uint input_stride, uint num_row_steps, uint num_col_steps, uint row_tiles_per_step, uint shared_mem_per_warp_size_byte) { extern __shared__ half shared_mem[]; uint warp_id = (threadIdx.x >> WARP_SIZE_LOG_2); uint sample_id = blockIdx.x * WARPS_PER_BLOCK + warp_id; if (sample_id >= batch_size) { return; } uint lane_id = threadIdx.x & (WARP_SIZE - 1); // ">> 1" to convert to half pointer uint smem_warp_offset = warp_id * (shared_mem_per_warp_size_byte >> 1); half *smem_in = &shared_mem[smem_warp_offset]; half *smem_temp = &shared_mem[smem_warp_offset + input_size_elems]; float *smem_out = reinterpret_cast<float *>(smem_temp); // Global memory pointers for the current sample // Input uint gmem_input_sample_offset = sample_id * sample_size; const half *gmem_input = &input[gmem_input_sample_offset]; // Interaction Gradient const uint &gmem_grad_sample_offset = gmem_input_sample_offset; half *gmem_grad = &grad[gmem_grad_sample_offset]; // Bottom MLP gradient half *gmem_mlp_grad = &bottom_mlp_grad[sample_id * num_cols]; // Upstream gradient vector uint gmem_ugrad_sample_offset = sample_id * (num_cols + interaction_ugrad_size_with_padding); const half *gmem_ugrad = &upstream_grad[gmem_ugrad_sample_offset]; // Upstream gradient vector for interactions const half *gmem_ugrad_interactions = &gmem_ugrad[num_cols]; // upstream grad -> shared memory (place in input section temporarily) #pragma unroll for (uint idx = lane_id; idx < (interaction_ugrad_size >> 3); idx += WARP_SIZE) { ((float4 *)smem_in)[idx] = ((float4 *)gmem_ugrad_interactions)[idx]; } uint offset = (interaction_ugrad_size >> 3) << 3; for (uint idx = lane_id + offset; idx < interaction_ugrad_size; idx += WARP_SIZE) { smem_in[idx] = gmem_ugrad_interactions[idx]; } __syncwarp(); // Form the 2D ugrad matrix. if (lane_id < num_rows_after_padding) { uint ugrad_flat_index = ((lane_id * (lane_id - 1)) >> 1); uint ugrad_offset_1 = lane_id * interaction_ugrad_2D_stride; for (uint row = 0; row < num_rows; row++) { half ugrad_val = __float2half(0.0f); if (row < lane_id && lane_id < num_rows) { ugrad_val = smem_in[ugrad_flat_index + row]; smem_temp[ugrad_offset_1 + row] = ugrad_val; } if (row <= lane_id && lane_id < num_rows_after_padding) { smem_temp[row * interaction_ugrad_2D_stride + lane_id] = ugrad_val; } } for (uint row = num_rows; row < num_rows_after_padding; row++) { smem_temp[row * interaction_ugrad_2D_stride + lane_id] = __float2half(0.0f); } } __syncwarp(); // Input -> Shared Memory if (lane_id < (num_cols >> 2)) { for (uint row = 0; row < num_rows; row++) { half *smem_row_ptr = &smem_in[row * input_stride]; const half *gmem_row_ptr = &gmem_input[row * num_cols]; ((float2 *)smem_row_ptr)[lane_id] = ((float2 *)gmem_row_ptr)[lane_id]; } } uint idx = lane_id + num_cols; if (idx < num_cols_after_padding) { for (uint row = 0; row < num_rows; row++) { half *smem_row_ptr = &smem_in[row * input_stride]; smem_row_ptr[idx] = __float2half(0); } } half4 zeros; zeros.vals[0].x = __float2half(0); zeros.vals[0].y = __float2half(0); zeros.vals[1].x = __float2half(0); zeros.vals[1].y = __float2half(0); if (lane_id < (num_cols_after_padding >> 2)) { #pragma unroll 2 for (uint row = num_rows; row < num_rows_after_padding; row++) { half *smem_row_ptr = &smem_in[row * input_stride]; ((half4 *)smem_row_ptr)[lane_id] = zeros; } } __syncwarp(); wmma::fragment<wmma::matrix_a, TILE_DIM, TILE_DIM, TILE_DIM, half, wmma::row_major> a[ROW_TILES_PER_STEP] [ROW_TILES_PER_STEP]; for (uint i = 0; i < ROW_TILES_PER_STEP; i++) { for (uint j = 0; j < ROW_TILES_PER_STEP; j++) { const half *tile_ptr = smem_temp + ((i * interaction_ugrad_2D_stride + j) << TILE_DIM_LOG_2); wmma::load_matrix_sync(a[i][j], tile_ptr, interaction_ugrad_2D_stride); } } wmma::fragment<wmma::accumulator, TILE_DIM, TILE_DIM, TILE_DIM, float> acc[ROW_TILES_PER_STEP]; wmma::fragment<wmma::matrix_b, TILE_DIM, TILE_DIM, TILE_DIM, half, wmma::row_major> b[ROW_TILES_PER_STEP]; for (int col_step = 0; col_step < num_col_steps; col_step++) { for (uint i = 0; i < ROW_TILES_PER_STEP; i++) { const half *tile_ptr = smem_in + ((i * input_stride + col_step) << TILE_DIM_LOG_2); wmma::fill_fragment(acc[i], 0); wmma::load_matrix_sync(b[i], tile_ptr, input_stride); } for (uint i = 0; i < ROW_TILES_PER_STEP; i++) { for (uint j = 0; j < ROW_TILES_PER_STEP; j++) { wmma::mma_sync(acc[i], a[i][j], b[j], acc[i]); } } for (uint i = 0; i < ROW_TILES_PER_STEP; i++) { float *tile_ptr = smem_out + i * TILE_DIM * TILE_DIM; wmma::store_matrix_sync(tile_ptr, acc[i], TILE_DIM, wmma::mem_row_major); } __syncwarp(); uint gmem_grad_col = (col_step << TILE_DIM_LOG_2) + lane_id; if (gmem_grad_col < num_cols) { for (uint i = 0; i < num_rows; i++) { gmem_grad[i * num_cols + gmem_grad_col] = __float2half(smem_out[(i << TILE_DIM_LOG_2) + lane_id]); } } } if (lane_id < (num_cols >> 2)) { ((float2 *)gmem_mlp_grad)[lane_id] = ((float2 *)gmem_ugrad)[lane_id]; } } inline void dotBasedInteractBwd(void *input, void *upstream_grad, void *grad, void *bottom_mlp_grad, uint batch_size, uint num_rows, uint num_cols) { const uint kWarpSize = 32; const uint kWarpSizeLog2 = Log2<kWarpSize>::value; const uint kTileDim = 16; const uint kTileDimLog2 = Log2<kTileDim>::value; const uint mem_skew_size = 8; const uint kWarpsPerBlock = 4; const uint kWarpsPerBlockLog2 = Log2<kWarpsPerBlock>::value; const uint kNumThreads = kWarpsPerBlock * kWarpSize; const uint kRowTilesPerStep = 2; const uint kColTilesPerStep = 1; uint row_tiles_per_step = num_rows > kTileDim ? kRowTilesPerStep : 1; // num tiles uint num_row_tiles = (num_rows + kTileDim - 1) >> kTileDimLog2; uint num_col_tiles = (num_cols + kTileDim - 1) >> kTileDimLog2; // number of rows and columns after padding uint num_rows_after_padding = kTileDim << 1; uint num_cols_after_padding = num_col_tiles << kTileDimLog2; // 2D ugrad size and stride uint interaction_ugrad_2D_stride = num_rows_after_padding + mem_skew_size; uint interaction_ugrad_2D_size_elems = num_rows_after_padding * interaction_ugrad_2D_stride; uint interaction_ugrad_2D_size_bytes = interaction_ugrad_2D_size_elems * sizeof(half); // 1D ugrad size uint interaction_ugrad_size = num_rows * (num_rows - 1) >> 1; uint interaction_ugrad_size_with_padding = ((interaction_ugrad_size-1)/8 + 1)*8; //round up to multiple of 8 // in_out place size and stride uint input_stride = num_cols_after_padding + mem_skew_size; uint input_size_elems = num_rows_after_padding * input_stride; uint input_size_bytes = input_size_elems * sizeof(half); // sample size uint sample_size = num_rows * num_cols; // output size uint output_size_elems = kTileDim * kTileDim * kRowTilesPerStep * kColTilesPerStep; uint output_size_bytes = output_size_elems * sizeof(float); // staging area size uint staging_area_size_bytes = output_size_bytes > interaction_ugrad_2D_size_bytes ? output_size_bytes : interaction_ugrad_2D_size_bytes; // Shared memory size uint shared_mem_per_warp_size_byte = input_size_bytes + staging_area_size_bytes; uint shared_mem_size_bytes = kWarpsPerBlock * shared_mem_per_warp_size_byte; uint num_blocks = (batch_size + kWarpsPerBlock - 1) >> kWarpsPerBlockLog2; uint num_row_steps = num_row_tiles / row_tiles_per_step; uint num_col_steps = num_col_tiles / kColTilesPerStep; bool float4_predicate = !((interaction_ugrad_size_with_padding & 7) || (num_cols & 7)); if (float4_predicate) { dotBasedInteractBwdKernel<kWarpsPerBlock, kNumThreads, kRowTilesPerStep, kColTilesPerStep, kWarpSize, kWarpSizeLog2, kTileDim, kTileDimLog2> <<<num_blocks, kNumThreads, shared_mem_size_bytes, at::cuda::getCurrentCUDAStream()>>>((const half *)input, (const half *)upstream_grad, (half *)grad, (half *)bottom_mlp_grad, batch_size, num_rows, num_cols, num_rows_after_padding, num_cols_after_padding, sample_size, interaction_ugrad_size, interaction_ugrad_size_with_padding, interaction_ugrad_2D_size_elems, interaction_ugrad_2D_stride, input_size_elems, input_stride, num_row_steps, num_col_steps, row_tiles_per_step, shared_mem_per_warp_size_byte); } else { dotBasedInteractBwdKernelNonAligned<kWarpsPerBlock, kNumThreads, kRowTilesPerStep, kColTilesPerStep, kWarpSize, kWarpSizeLog2, kTileDim, kTileDimLog2> <<<num_blocks, kNumThreads, shared_mem_size_bytes, at::cuda::getCurrentCUDAStream()>>>((const half *)input, (const half *)upstream_grad, (half *)grad, (half *)bottom_mlp_grad, batch_size, num_rows, num_cols, num_rows_after_padding, num_cols_after_padding, sample_size, interaction_ugrad_size, interaction_ugrad_size_with_padding, interaction_ugrad_2D_size_elems, interaction_ugrad_2D_stride, input_size_elems, input_stride, num_row_steps, num_col_steps, row_tiles_per_step, shared_mem_per_warp_size_byte); } }
PyTorch/Detection/Efficientdet/scripts/D0
D0
train-benchmark_AMP_V100-32G
#!/bin/bash function get_dataloader_workers { gpus=$(nvidia-smi -i 0 --query-gpu=count --format=csv,noheader) core=$(nproc --all) workers=$((core/gpus-2)) workers=$((workers>16?16:workers)) echo ${workers} } WORKERS=$(get_dataloader_workers) ./distributed_train.sh ${NUM_PROC:-8} /workspace/object_detection/datasets/coco --model efficientdet_d0 -b 60 --lr 1.63 --amp --opt fusedmomentum --warmup-epochs 50 --lr-noise 0.4 0.9 --output /model --worker ${WORKERS} --fill-color mean --model-ema --model-ema-decay 0.999 --eval-after 200 --epochs 300 --resume --smoothing 0.0 --pretrained-backbone-path /backbone_checkpoints/jocbackbone_statedict_B0.pth --memory-format nchw --sync-bn --fused-focal-loss --seed 12711 --benchmark-steps 500 --benchmark
PaddlePaddle/LanguageModeling/BERT/utils
utils
config
# Copyright (c) 2022 NVIDIA Corporation. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import os import copy import argparse import distutils.util import logging import dllogger import paddle from utils.task import Task from utils.save_load import _PDOPT_SUFFIX, _PDPARAMS_SUFFIX, _PROGRESS_SUFFIX _AUTO_LAST_EPOCH = 'auto' _DEFAULT_BERT_CONFIG = { 'bert-large-uncased': './bert_configs/bert-large-uncased.json', 'bert-large-cased': './bert_configs/bert-large-cased.json', 'bert-base-uncased': './bert_configs/bert-base-uncased.json', 'bert-base-cased': './bert_configs/bert-base-cased.json', } def _get_full_path_of_ckpt(args): if args.from_checkpoint is None: args.last_step_of_checkpoint = 0 return def _check_file_exist(path_with_prefix): pdopt_path = path_with_prefix + _PDOPT_SUFFIX pdparams_path = path_with_prefix + _PDPARAMS_SUFFIX progress_path = path_with_prefix + _PROGRESS_SUFFIX found = False if ( os.path.exists(pdopt_path) and os.path.exists(pdparams_path) and os.path.exists(progress_path) ): found = True return found, pdopt_path, pdparams_path, progress_path if not os.path.exists(args.from_checkpoint): logging.warning( f"Start training from scratch since no checkpoint is found." ) args.from_checkpoint = None args.last_step_of_checkpoint = 0 return target_from_checkpoint = os.path.join( args.from_checkpoint, args.model_prefix ) if args.last_step_of_checkpoint is None: args.last_step_of_checkpoint = 0 elif args.last_step_of_checkpoint == _AUTO_LAST_EPOCH: folders = os.listdir(args.from_checkpoint) args.last_step_of_checkpoint = 0 for folder in folders: tmp_ckpt_path = os.path.join( args.from_checkpoint, folder, args.model_prefix ) try: folder = int(folder) except ValueError: logging.warning( f"Skip folder '{folder}' since its name is not integer-convertable." ) continue if ( folder > args.last_step_of_checkpoint and _check_file_exist(tmp_ckpt_path)[0] ): args.last_step_of_checkpoint = folder step_with_prefix = ( os.path.join(str(args.last_step_of_checkpoint), args.model_prefix) if args.last_step_of_checkpoint > 0 else args.model_prefix ) target_from_checkpoint = os.path.join( args.from_checkpoint, step_with_prefix ) else: try: args.last_step_of_checkpoint = int(args.last_step_of_checkpoint) except ValueError: raise ValueError( f"The value of --last-step-of-checkpoint should be None, {_AUTO_LAST_EPOCH}" f" or integer >= 0, but receive {args.last_step_of_checkpoint}" ) args.from_checkpoint = target_from_checkpoint found, pdopt_path, pdparams_path, progress_path = _check_file_exist( args.from_checkpoint ) if not found: args.from_checkpoint = None args.last_step_of_checkpoint = 0 logging.warning( f"Cannot find {pdopt_path} and {pdparams_path} and {progress_path}, disable --from-checkpoint." ) def _get_full_path_of_pretrained_params(args, task=Task.pretrain): if ( args.from_pretrained_params is None and args.from_phase1_final_params is None ): args.last_step_of_checkpoint = 0 return if ( task == Task.pretrain and args.from_phase1_final_params is not None and args.last_step_of_checkpoint == 0 ): args.from_pretrained_params = args.from_phase1_final_params args.from_pretrained_params = os.path.join( args.from_pretrained_params, args.model_prefix ) pdparams_path = args.from_pretrained_params + _PDPARAMS_SUFFIX if not os.path.exists(pdparams_path): args.from_pretrained_params = None logging.warning( f"Cannot find {pdparams_path}, disable --from-pretrained-params." ) args.last_step_of_checkpoint = 0 def print_args(args): args_for_log = copy.deepcopy(args) dllogger.log(step='PARAMETER', data=vars(args_for_log)) def check_and_process_args(args, task=Task.pretrain): if task == Task.pretrain: assert not ( args.from_checkpoint is not None and args.from_pretrained_params is not None ), ( "--from-pretrained-params and --from-checkpoint should " "not be set simultaneously." ) assert not ( args.phase1 and args.phase2 ), "--phase1 and --phase2 should not be set simultaneously in bert pretraining." if args.from_phase1_final_params is not None: assert ( args.phase2 ), "--from-phase1-final-params should only be used in phase2" # SQuAD finetuning does not support suspend-resume yet.(TODO) _get_full_path_of_ckpt(args) if args.bert_model == 'custom': assert ( args.config_file is not None ), "--config-file must be specified if --bert-model=custom" elif args.config_file is None: args.config_file = _DEFAULT_BERT_CONFIG[args.bert_model] logging.info( f"According to the name of bert_model, the default config_file: {args.config_file} will be used." ) if args.from_checkpoint is None: _get_full_path_of_pretrained_params(args, task) assert os.path.isfile( args.config_file ), f"Cannot find config file in {args.config_file}" # cudnn mha fusion is only supported after v8.9.1 on Ampere and Hopper GPU device_capability = paddle.device.cuda.get_device_capability() cudnn_mha_supported = paddle.get_cudnn_version() >= 8901 and ( device_capability == (8, 0) or device_capability == (9, 0) ) if (not cudnn_mha_supported or args.amp is False) and args.fuse_mha is True: logging.info( f"cudnn mha fusion is not supported, fall back to unfused mha" ) args.fuse_mha = False def add_global_args(parser, task=Task.pretrain): group = parser.add_argument_group('Global') if task == Task.pretrain: group.add_argument( '--input-dir', type=str, default=None, required=True, help='The input data directory. Should be specified by users and contain .hdf5 files for the task.', ) group.add_argument('--num-workers', default=1, type=int) if task == Task.squad: group.add_argument( '--train-file', type=str, default=None, help='SQuAD json for training. E.g., train-v1.1.json', ) group.add_argument( '--predict-file', type=str, default=None, help='SQuAD json for predictions. E.g., dev-v1.1.json or test-v1.1.json', ) group.add_argument( "--eval-script", help="Script to evaluate squad predictions", default="evaluate.py", type=str, ) group.add_argument( '--epochs', type=int, default=3, help='The number of epochs for training.', ) group.add_argument( '--vocab-file', type=str, default=None, required=True, help="Vocabulary mapping/file BERT was pretrainined on", ) group.add_argument( '--output-dir', type=str, default=None, required=True, help='The output directory where the model checkpoints will be written. Should be specified by users.', ) group.add_argument( '--bert-model', type=str, default='bert-large-uncased', choices=( 'bert-base-uncased', 'bert-base-cased', 'bert-large-uncased', 'bert-large-cased', 'custom', ), help='Specifies the type of BERT model to use. If it is set as custom, ' 'the path to the config file must be given by specifying --config-file', ) group.add_argument( '--config-file', type=str, default=None, help='The BERT model config. If set to None, `<--bert-model>.json` in folder `bert_configs` will be used.', ) group.add_argument( '--max-steps', type=int, default=None, required=True if task == Task.pretrain else False, help='Total number of training steps to perform.', ) group.add_argument( '--log-freq', type=int, default=10, help='Frequency of logging loss.' ) group.add_argument( '--num-steps-per-checkpoint', type=int, default=100, help='Number of update steps until a model checkpoint is saved to disk.', ) # Init model group.add_argument( '--from-pretrained-params', type=str, default=None, help='Path to pretrained parameters. If set to None, no pretrained params will be used.', ) group.add_argument( '--from-checkpoint', type=str, default=None, help='A checkpoint path to resume training. If set to None, no checkpoint will be used. ' 'If not None, --from-pretrained-params will be ignored.', ) group.add_argument( '--last-step-of-checkpoint', type=str, default=None, help='The step id of the checkpoint given by --from-checkpoint. ' 'It should be None, auto, or integer > 0. If it is set as ' 'None, then training will start from the 1-th epoch. If it is set as ' 'auto, then it will search largest integer-convertable folder ' ' --from-checkpoint, which contains required checkpoint. ', ) if task == Task.pretrain: group.add_argument( '--from-phase1-final-params', type=str, default=None, help='Path to final checkpoint of phase1, which will be used to ' 'initialize the parameter in the first step of phase2, and ' 'ignored in the rest steps of phase2.', ) group.add_argument( '--steps-this-run', type=int, default=None, help='If provided, only run this many steps before exiting.', ) group.add_argument( '--seed', type=int, default=42, help="random seed for initialization" ) group.add_argument( '--report-file', type=str, default='./report.json', help='A file in which to store JSON experiment report.', ) group.add_argument( '--model-prefix', type=str, default='bert_paddle', help='The prefix name of model files to save/load.', ) group.add_argument( '--show-config', type=distutils.util.strtobool, default=True, help='To show arguments.', ) group.add_argument( '--enable-cpu-affinity', type=distutils.util.strtobool, default=True, help='To enable in-built GPU-CPU affinity.', ) group.add_argument( '--benchmark', action='store_true', help='To enable benchmark mode.' ) group.add_argument( '--benchmark-steps', type=int, default=20, help='Steps for a benchmark run, only applied when --benchmark is set.', ) group.add_argument( '--benchmark-warmup-steps', type=int, default=20, help='Warmup steps for a benchmark run, only applied when --benchmark is set.', ) return parser def add_training_args(parser, task=Task.pretrain): group = parser.add_argument_group('Training') group.add_argument( '--optimizer', default='Lamb', metavar="OPTIMIZER", choices=('Lamb', 'AdamW'), help='The name of optimizer. It should be one of {Lamb, AdamW}.', ) group.add_argument( '--gradient-merge-steps', type=int, default=1, help="Number of update steps to accumualte before performing a backward/update pass.", ) group.add_argument( '--learning-rate', type=float, default=1e-4, help='The initial learning rate.', ) group.add_argument( '--warmup-start-lr', type=float, default=0.0, help='The initial learning rate for warmup.', ) group.add_argument( '--warmup-proportion', type=float, default=0.01, help='Proportion of training to perform linear learning rate warmup for. ' 'For example, 0.1 = 10%% of training.', ) group.add_argument( '--beta1', type=float, default=0.9, help='The exponential decay rate for the 1st moment estimates.', ) group.add_argument( '--beta2', type=float, default=0.999, help='The exponential decay rate for the 2st moment estimates.', ) group.add_argument( '--epsilon', type=float, default=1e-6, help='A small float value for numerical stability.', ) group.add_argument( '--weight-decay', type=float, default=0.01, help='The weight decay coefficient.', ) group.add_argument( '--max-seq-length', default=512, type=int, help='The maximum total input sequence length after WordPiece tokenization. \n' 'Sequences longer than this will be truncated, and sequences shorter \n' 'than this will be padded.', ) if task == Task.pretrain: group.add_argument( '--batch-size', type=int, default=32, help='The batch size for training', ) group.add_argument( '--phase1', action='store_true', help='The phase of BERT pretraining. It should not be set ' 'with --phase2 at the same time.', ) group.add_argument( '--phase2', action='store_true', help='The phase of BERT pretraining. It should not be set ' 'with --phase1 at the same time.', ) group.add_argument( '--max-predictions-per-seq', default=80, type=int, help='The maximum total of masked tokens in the input sequence', ) if task == Task.squad: group.add_argument( "--do-train", action='store_true', help="Whether to run training." ) group.add_argument( "--do-predict", action='store_true', help="Whether to run eval on the dev set.", ) group.add_argument( "--do-eval", action='store_true', help="Whether to use evaluate accuracy of predictions", ) group.add_argument( "--train-batch-size", default=32, type=int, help="Total batch size for training.", ) group.add_argument( "--predict-batch-size", default=8, type=int, help="Total batch size for predictions.", ) group.add_argument( "--verbose-logging", action='store_true', help="If true, all of the warnings related to data processing will be printed. " "A number of warnings are expected for a normal SQuAD evaluation.", ) group.add_argument( "--doc-stride", default=128, type=int, help="When splitting up a long document into chunks, how much stride to take " "between chunks.", ) group.add_argument( "--max-query-length", default=64, type=int, help="The maximum number of tokens for the question. Questions longer than this " "will be truncated to this length.", ) group.add_argument( "--n-best-size", default=20, type=int, help="The total number of n-best predictions to generate in the nbest_predictions.json " "output file.", ) group.add_argument( "--max-answer-length", default=30, type=int, help="The maximum length of an answer that can be generated. This is needed because the start " "and end predictions are not conditioned on one another.", ) group.add_argument( "--do-lower-case", action='store_true', help="Whether to lower case the input text. True for uncased models, False for cased models.", ) group.add_argument( '--version-2-with-negative', action='store_true', help='If true, the SQuAD examples contain some that do not have an answer.', ) group.add_argument( '--null-score-diff-threshold', type=float, default=0.0, help="If null_score - best_non_null is greater than the threshold predict null.", ) return parser def add_advance_args(parser): group = parser.add_argument_group('Advanced Training') group.add_argument( '--amp', action='store_true', help='Enable automatic mixed precision training (AMP).', ) group.add_argument( '--scale-loss', type=float, default=1.0, help='The loss scalar for AMP training, only applied when --amp is set.', ) group.add_argument( '--use-dynamic-loss-scaling', action='store_true', help='Enable dynamic loss scaling in AMP training, only applied when --amp is set.', ) group.add_argument( '--use-pure-fp16', action='store_true', help='Enable pure FP16 training, only applied when --amp is set.', ) group.add_argument( '--fuse-mha', action='store_true', help='Enable multihead attention fusion. Require cudnn version >= 8.9.1', ) return parser def parse_args(task=Task.pretrain): parser = argparse.ArgumentParser( description="PaddlePaddle BERT pretraining script" if task == Task.pretrain else "PaddlePaddle SQuAD finetuning script", formatter_class=argparse.ArgumentDefaultsHelpFormatter, ) parser = add_global_args(parser, task) parser = add_training_args(parser, task) parser = add_advance_args(parser) args = parser.parse_args() check_and_process_args(args, task) return args
PyTorch/LanguageModeling/Transformer-XL/pytorch/utils
utils
__init__
# Copyright (c) 2019-2020, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. from . import distributed from . import exp_utils from . import gpu_affinity
TensorFlow/LanguageModeling/BERT/scripts
scripts
run_glue_inference
#!/usr/bin/env bash # Copyright (c) 2019 NVIDIA CORPORATION. All rights reserved. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. echo "Container nvidia build = " $NVIDIA_BUILD_ID task_name=${1:-"MRPC"} init_checkpoint=${2:-"$BERT_DIR/model.ckpt"} batch_size=${3:-"32"} precision=${4:-"fp16"} use_xla=${5:-"true"} seq_length=${6:-"128"} doc_stride=${7:-"64"} bert_model=${8:-"large"} if [ "$bert_model" = "large" ] ; then export BERT_DIR=data/download/nvidia_pretrained/bert_tf_pretraining_large_lamb else export BERT_DIR=data/download/nvidia_pretrained/bert_tf_squad11_base_128 fi GLUE_DIR=data/download echo "GLUE directory set as " $GLUE_DIR " BERT directory set as " $BERT_DIR use_fp16="" if [ "$precision" = "fp16" ] ; then echo "fp16 activated!" use_fp16="--amp" else echo "fp32/tf32 activated!" use_fp16="--noamp" fi if [ "$use_xla" = "true" ] ; then use_xla_tag="--use_xla" echo "XLA activated" else use_xla_tag="--nouse_xla" fi num_gpu=1 ckpt_str=${init_checkpoint//\//-} export GBS=$(expr $batch_size \* $num_gpu) printf -v TAG "tf_bert_finetuning_glue_%s_inf_%s_%s_gbs%d_ckpt_%s" "$task_name" "$bert_model" "$precision" $GBS "$ckpt_str" DATESTAMP=`date +'%y%m%d%H%M%S'` #Edit to save logs & checkpoints in a different directory RESULTS_DIR=/results LOGFILE=$RESULTS_DIR/$TAG.$DATESTAMP.log printf "Logs written to %s\n" "$LOGFILE" #Check if all necessary files are available before training for DIR_or_file in $GLUE_DIR $RESULTS_DIR $BERT_DIR/vocab.txt $BERT_DIR/bert_config.json; do if [ ! -d "$DIR_or_file" ] && [ ! -f "$DIR_or_file" ]; then echo "Error! $DIR_or_file directory missing. Please mount correctly" exit -1 fi done $mpi_command python run_classifier.py \ --task_name=$task_name \ --predict_batch_size=$batch_size \ --eval_batch_size=$batch_size \ --do_eval=true \ --data_dir=$GLUE_DIR/$task_name \ --vocab_file=$BERT_DIR/vocab.txt \ --bert_config_file=$BERT_DIR/bert_config.json \ --init_checkpoint=$init_checkpoint \ --max_seq_length=$seq_length \ --doc_stride=$doc_stride \ --output_dir=$RESULTS_DIR \ --horovod "$use_fp16" \ $use_xla_tag |& tee $LOGFILE
PyTorch/SpeechRecognition/wav2vec2/scripts
scripts
finetune_vox_100h
#!/usr/bin/env bash # Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. set -a # A100 80GiB FP16: UPDATE_FREQ=1 # A100 80GiB TF32: UPDATE_FREQ=1 # IO : ${DATASET_DIR:="/datasets/LibriSpeech"} : ${TRAIN_SUBSET:="train-clean-100"} : ${OUTPUT_DIR:="results/finetune_large_100h"} # Batching # We train with effective world_size=16; the reference sets for world_size=20 : ${NUM_GPUS:=8} : ${MAX_TOKENS:=1280000} : ${NUM_CONCAT_BATCHES:=2} : ${UPDATE_FREQ:=1} # Training : ${MAX_UPDATE:=80000} : ${MASK_CHANNEL_PROB:=0.5} : ${MASK_PROB:=0.5} bash scripts/finetune_vox_960h.sh "$@"
PaddlePaddle/LanguageModeling/BERT/utils
utils
affinity
# Copyright (c) 2022 NVIDIA Corporation. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import os import logging import paddle def _get_gpu_affinity_table(): """ Generate three dict objects, gpu_cpu_affinity_map, cpu_socket_gpus_list, cpu_core_groups. gpu_cpu_affinity_map (dict): Key is GPU ID and value is cpu_affinity string. cpu_socket_gpus_list (dict): Key is cpu_affinity string and value is a list collected all GPU IDs that affinity to this cpu socket. cpu_core_groups (dict): Key is cpu_affinity string and value is cpu core groups. cpu core groups contains #GPUs groups, each group have, nearly eaual amount of cpu cores. Example: $nvidis-smi topo -m GPU0 GPU1 GPU2 GPU3 CPU Affinity NUMA Affinity GPU0 X SYS SYS SYS 0-9,20-29 0 GPU1 SYS X SYS SYS 0-9,20-29 0 GPU2 SYS SYS X SYS 10-19,30-39 1 GPU3 SYS SYS SYS X 10-19,30-39 1 gpu_cpu_affinity_map = { 0: '0-9,20-29', # GPU0's cpu affninity is '0-9,20-29' 1: '0-9,20-29', # GPU1's cpu affninity is '0-9,20-29' 2: '10-19,30-39', # GPU2's cpu affninity is '10-19,30-39' 3: '10-19,30-39' } # GPU3's cpu affninity is '10-19,30-39' cpu_socket_gpus_list = { '0-9,20-29': [0, 1], # There are 2 GPUs, 0 and 1, belong to cpu affinity '0-9,20-29'. '10-19,30-39': [2, 3] # There are 2 GPUs, 2 and 3, belong to cpu affinity '10-19,30-39'. } cpu_core_groups = # There are 2 GPUs belong to cpu affinity '0-9,20-29', then # cores [0, 1, ..., 8, 9] would be split to two groups every # 2-th elements # [0, 2, 4, 6, 8] and [1, 3, 5, 7, 9] # The same for cores [20, 21, ..., 28, 29]. {'0-9,20-29': [ [[0, 2, 4, 6, 8], [1, 3, 5, 7, 9]], [[20, 22, 24, 26, 28], [21, 23, 25, 27, 29]] ], # The same as '0-9,20-29' '10-19,30-39': [ [[10, 12, 14, 16, 18], [11, 13, 15, 17, 19]], [[30, 32, 34, 36, 38], [31, 33, 35, 37, 39]] ]} """ lines = os.popen('nvidia-smi topo -m').readlines() cpu_affinity_idx = -1 titles = lines[0].split('\t') for idx in range(len(titles)): if 'CPU Affinity' in titles[idx]: cpu_affinity_idx = idx assert cpu_affinity_idx > 0, \ "Can not obtain correct CPU affinity column index via nvidia-smi!" gpu_cpu_affinity_map = dict() cpu_socket_gpus_list = dict() # Skip title for idx in range(1, len(lines)): line = lines[idx] items = line.split('\t') if 'GPU' in items[0]: gpu_id = int(items[0][3:]) affinity = items[cpu_affinity_idx] gpu_cpu_affinity_map[gpu_id] = affinity if affinity in cpu_socket_gpus_list: cpu_socket_gpus_list[affinity].append(gpu_id) else: cpu_socket_gpus_list[affinity] = [gpu_id] cpu_core_groups = _group_cpu_cores(cpu_socket_gpus_list) return gpu_cpu_affinity_map, cpu_socket_gpus_list, cpu_core_groups def _group_cpu_cores(cpu_socket_gpus_list): """ Generate a dictionary that key is cpu_affinity string and value is cpu core groups. cpu core groups contains #GPUs groups, each group have, nearly eaual amount of cpu cores. The grouping way is collect cpu cores every #GPUs-th elements, due to index of hyperthreading. For examle, 4 physical cores, 8 cores with hyperthreading. The CPU indices [0, 1, 2, 3] is physical cores, and [4, 5, 6, 7] is hyperthreading. In this case, distributing physical cores first, then hyperthreading would reach better performance. Args: cpu_socket_gpus_list (dict): a dict that map cpu_affinity_str to all GPUs that belong to it. Return: cpu_core_groups (dict): a dict that map cpu_affinity_str to cpu core groups. Example: cpu_socket_gpus_list = { '0-9,20-29': [0, 1], '10-19,30-39': [2, 3] }, which means there are 2 GPUs, 0 and 1, belong to '0-9,20-29' and 2 GPUs, 2 and 3, belong to '10-19,30-39' therefore, cpu_core_groups = {'0-9,20-29': [ [[0, 2, 4, 6, 8], [1, 3, 5, 7, 9]], [[20, 22, 24, 26, 28], [21, 23, 25, 27, 29]] ], '10-19,30-39': [ [[10, 12, 14, 16, 18], [11, 13, 15, 17, 19]], [[30, 32, 34, 36, 38], [31, 33, 35, 37, 39]] ]} """ cpu_core_groups = dict() for cpu_socket in cpu_socket_gpus_list: cpu_core_groups[cpu_socket] = list() gpu_count = len(cpu_socket_gpus_list[cpu_socket]) cores = cpu_socket.split(',') for core in cores: core_indices = _get_core_indices(core) core_group = list() for i in range(gpu_count): start = i % len(core_indices) sub_core_set = core_indices[start::gpu_count] core_group.append(sub_core_set) cpu_core_groups[cpu_socket].append(core_group) return cpu_core_groups def _get_core_indices(cores_str): """ Generate a dictionary of cpu core indices. Args: cores_str (str): a string with format "start_idx-end_idx". Return: cpu_core_indices (list): a list collected all indices in [start_idx, end_idx]. Example: cores_str = '0-20' cpu_core_indices = [0, 1, 2, ..., 18, 19, 20] """ start, end = cores_str.split('-') return [*range(int(start), int(end) + 1)] def set_cpu_affinity(): """ Setup CPU affinity. Each GPU would be bound to a specific set of CPU cores for optimal and stable performance. This function would obtain GPU-CPU affinity via "nvidia-smi topo -m", then equally distribute CPU cores to each GPU. """ gpu_cpu_affinity_map, cpu_socket_gpus_list, cpu_core_groups = \ _get_gpu_affinity_table() node_num = paddle.distributed.fleet.node_num() gpu_per_node = paddle.distributed.get_world_size() // node_num local_rank = paddle.distributed.get_rank() % gpu_per_node # gpu_cpu_affinity_map (dict): Key is GPU ID and value is cpu_affinity string. # cpu_socket_gpus_list (dict): Key is cpu_affinity string and value is a list # collected all GPU IDs that affinity to this cpu socket. # cpu_core_groups (dict): Key is cpu_affinity string and value is cpu core groups. # cpu core groups contains #GPUs groups, each group have, # nearly eaual amount of cpu cores. # Example: # $nvidis-smi topo -m # GPU0 GPU1 GPU2 GPU3 CPU Affinity NUMA Affinity # GPU0 X SYS SYS SYS 0-9,20-29 0 # GPU1 SYS X SYS SYS 0-9,20-29 0 # GPU2 SYS SYS X SYS 10-19,30-39 1 # GPU3 SYS SYS SYS X 10-19,30-39 1 # # gpu_cpu_affinity_map = # { 0: '0-9,20-29', # 1: '0-9,20-29', # 2: '10-19,30-39', # 3: '10-19,30-39' } # cpu_socket_gpus_list = # { '0-9,20-29': [0, 1], # '10-19,30-39': [2, 3] } # cpu_core_groups = # {'0-9,20-29': [ # [[0, 2, 4, 6, 8], [1, 3, 5, 7, 9]], # [[20, 22, 24, 26, 28], [21, 23, 25, 27, 29]] # ], # '10-19,30-39': [ # [[10, 12, 14, 16, 18], [11, 13, 15, 17, 19]], # [[30, 32, 34, 36, 38], [31, 33, 35, 37, 39]] # ]} # # for rank-0, it belong to '0-9,20-29' cpu_affinity_key, # and it locate in index-0 of cpu_socket_gpus_list['0-9,20-29'], # therefore, affinity_mask would be a collection of all cpu cores # in index-0 of cpu_core_groups['0-9,20-29'], that is [0, 2, 4, 6, 8] # and [20, 22, 24, 26, 28]. # affinity_mask = [0, 2, 4, 6, 8, 20, 22, 24, 26, 28] affinity_mask = list() cpu_affinity_key = gpu_cpu_affinity_map[local_rank] cpu_core_idx = cpu_socket_gpus_list[cpu_affinity_key].index(local_rank) for cpu_core_group in cpu_core_groups[cpu_affinity_key]: affinity_mask.extend(cpu_core_group[cpu_core_idx]) pid = os.getpid() os.sched_setaffinity(pid, affinity_mask) logging.info("Set CPU affinity of rank-%d (Process %d) " "to %s.", local_rank, pid, str(os.sched_getaffinity(pid)))
TensorFlow/Detection/SSD/models/research/object_detection/core
core
post_processing_test
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== """Tests for tensorflow_models.object_detection.core.post_processing.""" import numpy as np import tensorflow as tf from object_detection.core import post_processing from object_detection.core import standard_fields as fields from object_detection.utils import test_case class MulticlassNonMaxSuppressionTest(test_case.TestCase): def test_multiclass_nms_select_with_shared_boxes(self): boxes = tf.constant([[[0, 0, 1, 1]], [[0, 0.1, 1, 1.1]], [[0, -0.1, 1, 0.9]], [[0, 10, 1, 11]], [[0, 10.1, 1, 11.1]], [[0, 100, 1, 101]], [[0, 1000, 1, 1002]], [[0, 1000, 1, 1002.1]]], tf.float32) scores = tf.constant([[.9, 0.01], [.75, 0.05], [.6, 0.01], [.95, 0], [.5, 0.01], [.3, 0.01], [.01, .85], [.01, .5]]) score_thresh = 0.1 iou_thresh = .5 max_output_size = 4 exp_nms_corners = [[0, 10, 1, 11], [0, 0, 1, 1], [0, 1000, 1, 1002], [0, 100, 1, 101]] exp_nms_scores = [.95, .9, .85, .3] exp_nms_classes = [0, 0, 1, 0] nms, _ = post_processing.multiclass_non_max_suppression( boxes, scores, score_thresh, iou_thresh, max_output_size) with self.test_session() as sess: nms_corners_output, nms_scores_output, nms_classes_output = sess.run( [nms.get(), nms.get_field(fields.BoxListFields.scores), nms.get_field(fields.BoxListFields.classes)]) self.assertAllClose(nms_corners_output, exp_nms_corners) self.assertAllClose(nms_scores_output, exp_nms_scores) self.assertAllClose(nms_classes_output, exp_nms_classes) # TODO(bhattad): Remove conditional after CMLE moves to TF 1.9 def test_multiclass_nms_select_with_shared_boxes_given_keypoints(self): boxes = tf.constant([[[0, 0, 1, 1]], [[0, 0.1, 1, 1.1]], [[0, -0.1, 1, 0.9]], [[0, 10, 1, 11]], [[0, 10.1, 1, 11.1]], [[0, 100, 1, 101]], [[0, 1000, 1, 1002]], [[0, 1000, 1, 1002.1]]], tf.float32) scores = tf.constant([[.9, 0.01], [.75, 0.05], [.6, 0.01], [.95, 0], [.5, 0.01], [.3, 0.01], [.01, .85], [.01, .5]]) num_keypoints = 6 keypoints = tf.tile( tf.reshape(tf.range(8), [8, 1, 1]), [1, num_keypoints, 2]) score_thresh = 0.1 iou_thresh = .5 max_output_size = 4 exp_nms_corners = [[0, 10, 1, 11], [0, 0, 1, 1], [0, 1000, 1, 1002], [0, 100, 1, 101]] exp_nms_scores = [.95, .9, .85, .3] exp_nms_classes = [0, 0, 1, 0] exp_nms_keypoints_tensor = tf.tile( tf.reshape(tf.constant([3, 0, 6, 5], dtype=tf.float32), [4, 1, 1]), [1, num_keypoints, 2]) nms, _ = post_processing.multiclass_non_max_suppression( boxes, scores, score_thresh, iou_thresh, max_output_size, additional_fields={fields.BoxListFields.keypoints: keypoints}) with self.test_session() as sess: (nms_corners_output, nms_scores_output, nms_classes_output, nms_keypoints, exp_nms_keypoints) = sess.run([ nms.get(), nms.get_field(fields.BoxListFields.scores), nms.get_field(fields.BoxListFields.classes), nms.get_field(fields.BoxListFields.keypoints), exp_nms_keypoints_tensor ]) self.assertAllClose(nms_corners_output, exp_nms_corners) self.assertAllClose(nms_scores_output, exp_nms_scores) self.assertAllClose(nms_classes_output, exp_nms_classes) self.assertAllEqual(nms_keypoints, exp_nms_keypoints) def test_multiclass_nms_with_shared_boxes_given_keypoint_heatmaps(self): boxes = tf.constant([[[0, 0, 1, 1]], [[0, 0.1, 1, 1.1]], [[0, -0.1, 1, 0.9]], [[0, 10, 1, 11]], [[0, 10.1, 1, 11.1]], [[0, 100, 1, 101]], [[0, 1000, 1, 1002]], [[0, 1000, 1, 1002.1]]], tf.float32) scores = tf.constant([[.9, 0.01], [.75, 0.05], [.6, 0.01], [.95, 0], [.5, 0.01], [.3, 0.01], [.01, .85], [.01, .5]]) num_boxes = tf.shape(boxes)[0] heatmap_height = 5 heatmap_width = 5 num_keypoints = 17 keypoint_heatmaps = tf.ones( [num_boxes, heatmap_height, heatmap_width, num_keypoints], dtype=tf.float32) score_thresh = 0.1 iou_thresh = .5 max_output_size = 4 exp_nms_corners = [[0, 10, 1, 11], [0, 0, 1, 1], [0, 1000, 1, 1002], [0, 100, 1, 101]] exp_nms_scores = [.95, .9, .85, .3] exp_nms_classes = [0, 0, 1, 0] exp_nms_keypoint_heatmaps = np.ones( (4, heatmap_height, heatmap_width, num_keypoints), dtype=np.float32) nms, _ = post_processing.multiclass_non_max_suppression( boxes, scores, score_thresh, iou_thresh, max_output_size, additional_fields={ fields.BoxListFields.keypoint_heatmaps: keypoint_heatmaps }) with self.test_session() as sess: (nms_corners_output, nms_scores_output, nms_classes_output, nms_keypoint_heatmaps) = sess.run( [nms.get(), nms.get_field(fields.BoxListFields.scores), nms.get_field(fields.BoxListFields.classes), nms.get_field(fields.BoxListFields.keypoint_heatmaps)]) self.assertAllClose(nms_corners_output, exp_nms_corners) self.assertAllClose(nms_scores_output, exp_nms_scores) self.assertAllClose(nms_classes_output, exp_nms_classes) self.assertAllEqual(nms_keypoint_heatmaps, exp_nms_keypoint_heatmaps) def test_multiclass_nms_with_additional_fields(self): boxes = tf.constant([[[0, 0, 1, 1]], [[0, 0.1, 1, 1.1]], [[0, -0.1, 1, 0.9]], [[0, 10, 1, 11]], [[0, 10.1, 1, 11.1]], [[0, 100, 1, 101]], [[0, 1000, 1, 1002]], [[0, 1000, 1, 1002.1]]], tf.float32) scores = tf.constant([[.9, 0.01], [.75, 0.05], [.6, 0.01], [.95, 0], [.5, 0.01], [.3, 0.01], [.01, .85], [.01, .5]]) coarse_boxes_key = 'coarse_boxes' coarse_boxes = tf.constant([[0.1, 0.1, 1.1, 1.1], [0.1, 0.2, 1.1, 1.2], [0.1, -0.2, 1.1, 1.0], [0.1, 10.1, 1.1, 11.1], [0.1, 10.2, 1.1, 11.2], [0.1, 100.1, 1.1, 101.1], [0.1, 1000.1, 1.1, 1002.1], [0.1, 1000.1, 1.1, 1002.2]], tf.float32) score_thresh = 0.1 iou_thresh = .5 max_output_size = 4 exp_nms_corners = np.array([[0, 10, 1, 11], [0, 0, 1, 1], [0, 1000, 1, 1002], [0, 100, 1, 101]], dtype=np.float32) exp_nms_coarse_corners = np.array([[0.1, 10.1, 1.1, 11.1], [0.1, 0.1, 1.1, 1.1], [0.1, 1000.1, 1.1, 1002.1], [0.1, 100.1, 1.1, 101.1]], dtype=np.float32) exp_nms_scores = [.95, .9, .85, .3] exp_nms_classes = [0, 0, 1, 0] nms, _ = post_processing.multiclass_non_max_suppression( boxes, scores, score_thresh, iou_thresh, max_output_size, additional_fields={coarse_boxes_key: coarse_boxes}) with self.test_session() as sess: (nms_corners_output, nms_scores_output, nms_classes_output, nms_coarse_corners) = sess.run( [nms.get(), nms.get_field(fields.BoxListFields.scores), nms.get_field(fields.BoxListFields.classes), nms.get_field(coarse_boxes_key)]) self.assertAllClose(nms_corners_output, exp_nms_corners) self.assertAllClose(nms_scores_output, exp_nms_scores) self.assertAllClose(nms_classes_output, exp_nms_classes) self.assertAllEqual(nms_coarse_corners, exp_nms_coarse_corners) def test_multiclass_nms_select_with_shared_boxes_given_masks(self): boxes = tf.constant([[[0, 0, 1, 1]], [[0, 0.1, 1, 1.1]], [[0, -0.1, 1, 0.9]], [[0, 10, 1, 11]], [[0, 10.1, 1, 11.1]], [[0, 100, 1, 101]], [[0, 1000, 1, 1002]], [[0, 1000, 1, 1002.1]]], tf.float32) scores = tf.constant([[.9, 0.01], [.75, 0.05], [.6, 0.01], [.95, 0], [.5, 0.01], [.3, 0.01], [.01, .85], [.01, .5]]) num_classes = 2 mask_height = 3 mask_width = 3 masks = tf.tile( tf.reshape(tf.range(8), [8, 1, 1, 1]), [1, num_classes, mask_height, mask_width]) score_thresh = 0.1 iou_thresh = .5 max_output_size = 4 exp_nms_corners = [[0, 10, 1, 11], [0, 0, 1, 1], [0, 1000, 1, 1002], [0, 100, 1, 101]] exp_nms_scores = [.95, .9, .85, .3] exp_nms_classes = [0, 0, 1, 0] exp_nms_masks_tensor = tf.tile( tf.reshape(tf.constant([3, 0, 6, 5], dtype=tf.float32), [4, 1, 1]), [1, mask_height, mask_width]) nms, _ = post_processing.multiclass_non_max_suppression( boxes, scores, score_thresh, iou_thresh, max_output_size, masks=masks) with self.test_session() as sess: (nms_corners_output, nms_scores_output, nms_classes_output, nms_masks, exp_nms_masks) = sess.run([nms.get(), nms.get_field(fields.BoxListFields.scores), nms.get_field(fields.BoxListFields.classes), nms.get_field(fields.BoxListFields.masks), exp_nms_masks_tensor]) self.assertAllClose(nms_corners_output, exp_nms_corners) self.assertAllClose(nms_scores_output, exp_nms_scores) self.assertAllClose(nms_classes_output, exp_nms_classes) self.assertAllEqual(nms_masks, exp_nms_masks) def test_multiclass_nms_select_with_clip_window(self): boxes = tf.constant([[[0, 0, 10, 10]], [[1, 1, 11, 11]]], tf.float32) scores = tf.constant([[.9], [.75]]) clip_window = tf.constant([5, 4, 8, 7], tf.float32) score_thresh = 0.0 iou_thresh = 0.5 max_output_size = 100 exp_nms_corners = [[5, 4, 8, 7]] exp_nms_scores = [.9] exp_nms_classes = [0] nms, _ = post_processing.multiclass_non_max_suppression( boxes, scores, score_thresh, iou_thresh, max_output_size, clip_window=clip_window) with self.test_session() as sess: nms_corners_output, nms_scores_output, nms_classes_output = sess.run( [nms.get(), nms.get_field(fields.BoxListFields.scores), nms.get_field(fields.BoxListFields.classes)]) self.assertAllClose(nms_corners_output, exp_nms_corners) self.assertAllClose(nms_scores_output, exp_nms_scores) self.assertAllClose(nms_classes_output, exp_nms_classes) def test_multiclass_nms_select_with_clip_window_change_coordinate_frame(self): boxes = tf.constant([[[0, 0, 10, 10]], [[1, 1, 11, 11]]], tf.float32) scores = tf.constant([[.9], [.75]]) clip_window = tf.constant([5, 4, 8, 7], tf.float32) score_thresh = 0.0 iou_thresh = 0.5 max_output_size = 100 exp_nms_corners = [[0, 0, 1, 1]] exp_nms_scores = [.9] exp_nms_classes = [0] nms, _ = post_processing.multiclass_non_max_suppression( boxes, scores, score_thresh, iou_thresh, max_output_size, clip_window=clip_window, change_coordinate_frame=True) with self.test_session() as sess: nms_corners_output, nms_scores_output, nms_classes_output = sess.run( [nms.get(), nms.get_field(fields.BoxListFields.scores), nms.get_field(fields.BoxListFields.classes)]) self.assertAllClose(nms_corners_output, exp_nms_corners) self.assertAllClose(nms_scores_output, exp_nms_scores) self.assertAllClose(nms_classes_output, exp_nms_classes) def test_multiclass_nms_select_with_per_class_cap(self): boxes = tf.constant([[[0, 0, 1, 1]], [[0, 0.1, 1, 1.1]], [[0, -0.1, 1, 0.9]], [[0, 10, 1, 11]], [[0, 10.1, 1, 11.1]], [[0, 100, 1, 101]], [[0, 1000, 1, 1002]], [[0, 1000, 1, 1002.1]]], tf.float32) scores = tf.constant([[.9, 0.01], [.75, 0.05], [.6, 0.01], [.95, 0], [.5, 0.01], [.3, 0.01], [.01, .85], [.01, .5]]) score_thresh = 0.1 iou_thresh = .5 max_size_per_class = 2 exp_nms_corners = [[0, 10, 1, 11], [0, 0, 1, 1], [0, 1000, 1, 1002]] exp_nms_scores = [.95, .9, .85] exp_nms_classes = [0, 0, 1] nms, _ = post_processing.multiclass_non_max_suppression( boxes, scores, score_thresh, iou_thresh, max_size_per_class) with self.test_session() as sess: nms_corners_output, nms_scores_output, nms_classes_output = sess.run( [nms.get(), nms.get_field(fields.BoxListFields.scores), nms.get_field(fields.BoxListFields.classes)]) self.assertAllClose(nms_corners_output, exp_nms_corners) self.assertAllClose(nms_scores_output, exp_nms_scores) self.assertAllClose(nms_classes_output, exp_nms_classes) def test_multiclass_nms_select_with_total_cap(self): boxes = tf.constant([[[0, 0, 1, 1]], [[0, 0.1, 1, 1.1]], [[0, -0.1, 1, 0.9]], [[0, 10, 1, 11]], [[0, 10.1, 1, 11.1]], [[0, 100, 1, 101]], [[0, 1000, 1, 1002]], [[0, 1000, 1, 1002.1]]], tf.float32) scores = tf.constant([[.9, 0.01], [.75, 0.05], [.6, 0.01], [.95, 0], [.5, 0.01], [.3, 0.01], [.01, .85], [.01, .5]]) score_thresh = 0.1 iou_thresh = .5 max_size_per_class = 4 max_total_size = 2 exp_nms_corners = [[0, 10, 1, 11], [0, 0, 1, 1]] exp_nms_scores = [.95, .9] exp_nms_classes = [0, 0] nms, _ = post_processing.multiclass_non_max_suppression( boxes, scores, score_thresh, iou_thresh, max_size_per_class, max_total_size) with self.test_session() as sess: nms_corners_output, nms_scores_output, nms_classes_output = sess.run( [nms.get(), nms.get_field(fields.BoxListFields.scores), nms.get_field(fields.BoxListFields.classes)]) self.assertAllClose(nms_corners_output, exp_nms_corners) self.assertAllClose(nms_scores_output, exp_nms_scores) self.assertAllClose(nms_classes_output, exp_nms_classes) def test_multiclass_nms_threshold_then_select_with_shared_boxes(self): boxes = tf.constant([[[0, 0, 1, 1]], [[0, 0.1, 1, 1.1]], [[0, -0.1, 1, 0.9]], [[0, 10, 1, 11]], [[0, 10.1, 1, 11.1]], [[0, 100, 1, 101]], [[0, 1000, 1, 1002]], [[0, 1000, 1, 1002.1]]], tf.float32) scores = tf.constant([[.9], [.75], [.6], [.95], [.5], [.3], [.01], [.01]]) score_thresh = 0.1 iou_thresh = .5 max_output_size = 3 exp_nms = [[0, 10, 1, 11], [0, 0, 1, 1], [0, 100, 1, 101]] nms, _ = post_processing.multiclass_non_max_suppression( boxes, scores, score_thresh, iou_thresh, max_output_size) with self.test_session() as sess: nms_output = sess.run(nms.get()) self.assertAllClose(nms_output, exp_nms) def test_multiclass_nms_select_with_separate_boxes(self): boxes = tf.constant([[[0, 0, 1, 1], [0, 0, 4, 5]], [[0, 0.1, 1, 1.1], [0, 0.1, 2, 1.1]], [[0, -0.1, 1, 0.9], [0, -0.1, 1, 0.9]], [[0, 10, 1, 11], [0, 10, 1, 11]], [[0, 10.1, 1, 11.1], [0, 10.1, 1, 11.1]], [[0, 100, 1, 101], [0, 100, 1, 101]], [[0, 1000, 1, 1002], [0, 999, 2, 1004]], [[0, 1000, 1, 1002.1], [0, 999, 2, 1002.7]]], tf.float32) scores = tf.constant([[.9, 0.01], [.75, 0.05], [.6, 0.01], [.95, 0], [.5, 0.01], [.3, 0.01], [.01, .85], [.01, .5]]) score_thresh = 0.1 iou_thresh = .5 max_output_size = 4 exp_nms_corners = [[0, 10, 1, 11], [0, 0, 1, 1], [0, 999, 2, 1004], [0, 100, 1, 101]] exp_nms_scores = [.95, .9, .85, .3] exp_nms_classes = [0, 0, 1, 0] nms, _ = post_processing.multiclass_non_max_suppression( boxes, scores, score_thresh, iou_thresh, max_output_size) with self.test_session() as sess: nms_corners_output, nms_scores_output, nms_classes_output = sess.run( [nms.get(), nms.get_field(fields.BoxListFields.scores), nms.get_field(fields.BoxListFields.classes)]) self.assertAllClose(nms_corners_output, exp_nms_corners) self.assertAllClose(nms_scores_output, exp_nms_scores) self.assertAllClose(nms_classes_output, exp_nms_classes) def test_batch_multiclass_nms_with_batch_size_1(self): boxes = tf.constant([[[[0, 0, 1, 1], [0, 0, 4, 5]], [[0, 0.1, 1, 1.1], [0, 0.1, 2, 1.1]], [[0, -0.1, 1, 0.9], [0, -0.1, 1, 0.9]], [[0, 10, 1, 11], [0, 10, 1, 11]], [[0, 10.1, 1, 11.1], [0, 10.1, 1, 11.1]], [[0, 100, 1, 101], [0, 100, 1, 101]], [[0, 1000, 1, 1002], [0, 999, 2, 1004]], [[0, 1000, 1, 1002.1], [0, 999, 2, 1002.7]]]], tf.float32) scores = tf.constant([[[.9, 0.01], [.75, 0.05], [.6, 0.01], [.95, 0], [.5, 0.01], [.3, 0.01], [.01, .85], [.01, .5]]]) score_thresh = 0.1 iou_thresh = .5 max_output_size = 4 exp_nms_corners = [[[0, 10, 1, 11], [0, 0, 1, 1], [0, 999, 2, 1004], [0, 100, 1, 101]]] exp_nms_scores = [[.95, .9, .85, .3]] exp_nms_classes = [[0, 0, 1, 0]] (nmsed_boxes, nmsed_scores, nmsed_classes, nmsed_masks, nmsed_additional_fields, num_detections ) = post_processing.batch_multiclass_non_max_suppression( boxes, scores, score_thresh, iou_thresh, max_size_per_class=max_output_size, max_total_size=max_output_size) self.assertIsNone(nmsed_masks) self.assertIsNone(nmsed_additional_fields) with self.test_session() as sess: (nmsed_boxes, nmsed_scores, nmsed_classes, num_detections) = sess.run([nmsed_boxes, nmsed_scores, nmsed_classes, num_detections]) self.assertAllClose(nmsed_boxes, exp_nms_corners) self.assertAllClose(nmsed_scores, exp_nms_scores) self.assertAllClose(nmsed_classes, exp_nms_classes) self.assertEqual(num_detections, [4]) def test_batch_multiclass_nms_with_batch_size_2(self): boxes = tf.constant([[[[0, 0, 1, 1], [0, 0, 4, 5]], [[0, 0.1, 1, 1.1], [0, 0.1, 2, 1.1]], [[0, -0.1, 1, 0.9], [0, -0.1, 1, 0.9]], [[0, 10, 1, 11], [0, 10, 1, 11]]], [[[0, 10.1, 1, 11.1], [0, 10.1, 1, 11.1]], [[0, 100, 1, 101], [0, 100, 1, 101]], [[0, 1000, 1, 1002], [0, 999, 2, 1004]], [[0, 1000, 1, 1002.1], [0, 999, 2, 1002.7]]]], tf.float32) scores = tf.constant([[[.9, 0.01], [.75, 0.05], [.6, 0.01], [.95, 0]], [[.5, 0.01], [.3, 0.01], [.01, .85], [.01, .5]]]) score_thresh = 0.1 iou_thresh = .5 max_output_size = 4 exp_nms_corners = np.array([[[0, 10, 1, 11], [0, 0, 1, 1], [0, 0, 0, 0], [0, 0, 0, 0]], [[0, 999, 2, 1004], [0, 10.1, 1, 11.1], [0, 100, 1, 101], [0, 0, 0, 0]]]) exp_nms_scores = np.array([[.95, .9, 0, 0], [.85, .5, .3, 0]]) exp_nms_classes = np.array([[0, 0, 0, 0], [1, 0, 0, 0]]) (nmsed_boxes, nmsed_scores, nmsed_classes, nmsed_masks, nmsed_additional_fields, num_detections ) = post_processing.batch_multiclass_non_max_suppression( boxes, scores, score_thresh, iou_thresh, max_size_per_class=max_output_size, max_total_size=max_output_size) self.assertIsNone(nmsed_masks) self.assertIsNone(nmsed_additional_fields) # Check static shapes self.assertAllEqual(nmsed_boxes.shape.as_list(), exp_nms_corners.shape) self.assertAllEqual(nmsed_scores.shape.as_list(), exp_nms_scores.shape) self.assertAllEqual(nmsed_classes.shape.as_list(), exp_nms_classes.shape) self.assertEqual(num_detections.shape.as_list(), [2]) with self.test_session() as sess: (nmsed_boxes, nmsed_scores, nmsed_classes, num_detections) = sess.run([nmsed_boxes, nmsed_scores, nmsed_classes, num_detections]) self.assertAllClose(nmsed_boxes, exp_nms_corners) self.assertAllClose(nmsed_scores, exp_nms_scores) self.assertAllClose(nmsed_classes, exp_nms_classes) self.assertAllClose(num_detections, [2, 3]) def test_batch_multiclass_nms_with_per_batch_clip_window(self): boxes = tf.constant([[[[0, 0, 1, 1], [0, 0, 4, 5]], [[0, 0.1, 1, 1.1], [0, 0.1, 2, 1.1]], [[0, -0.1, 1, 0.9], [0, -0.1, 1, 0.9]], [[0, 10, 1, 11], [0, 10, 1, 11]]], [[[0, 10.1, 1, 11.1], [0, 10.1, 1, 11.1]], [[0, 100, 1, 101], [0, 100, 1, 101]], [[0, 1000, 1, 1002], [0, 999, 2, 1004]], [[0, 1000, 1, 1002.1], [0, 999, 2, 1002.7]]]], tf.float32) scores = tf.constant([[[.9, 0.01], [.75, 0.05], [.6, 0.01], [.95, 0]], [[.5, 0.01], [.3, 0.01], [.01, .85], [.01, .5]]]) clip_window = tf.constant([0., 0., 200., 200.]) score_thresh = 0.1 iou_thresh = .5 max_output_size = 4 exp_nms_corners = np.array([[[0, 10, 1, 11], [0, 0, 1, 1], [0, 0, 0, 0], [0, 0, 0, 0]], [[0, 10.1, 1, 11.1], [0, 100, 1, 101], [0, 0, 0, 0], [0, 0, 0, 0]]]) exp_nms_scores = np.array([[.95, .9, 0, 0], [.5, .3, 0, 0]]) exp_nms_classes = np.array([[0, 0, 0, 0], [0, 0, 0, 0]]) (nmsed_boxes, nmsed_scores, nmsed_classes, nmsed_masks, nmsed_additional_fields, num_detections ) = post_processing.batch_multiclass_non_max_suppression( boxes, scores, score_thresh, iou_thresh, max_size_per_class=max_output_size, max_total_size=max_output_size, clip_window=clip_window) self.assertIsNone(nmsed_masks) self.assertIsNone(nmsed_additional_fields) # Check static shapes self.assertAllEqual(nmsed_boxes.shape.as_list(), exp_nms_corners.shape) self.assertAllEqual(nmsed_scores.shape.as_list(), exp_nms_scores.shape) self.assertAllEqual(nmsed_classes.shape.as_list(), exp_nms_classes.shape) self.assertEqual(num_detections.shape.as_list(), [2]) with self.test_session() as sess: (nmsed_boxes, nmsed_scores, nmsed_classes, num_detections) = sess.run([nmsed_boxes, nmsed_scores, nmsed_classes, num_detections]) self.assertAllClose(nmsed_boxes, exp_nms_corners) self.assertAllClose(nmsed_scores, exp_nms_scores) self.assertAllClose(nmsed_classes, exp_nms_classes) self.assertAllClose(num_detections, [2, 2]) def test_batch_multiclass_nms_with_per_image_clip_window(self): boxes = tf.constant([[[[0, 0, 1, 1], [0, 0, 4, 5]], [[0, 0.1, 1, 1.1], [0, 0.1, 2, 1.1]], [[0, -0.1, 1, 0.9], [0, -0.1, 1, 0.9]], [[0, 10, 1, 11], [0, 10, 1, 11]]], [[[0, 10.1, 1, 11.1], [0, 10.1, 1, 11.1]], [[0, 100, 1, 101], [0, 100, 1, 101]], [[0, 1000, 1, 1002], [0, 999, 2, 1004]], [[0, 1000, 1, 1002.1], [0, 999, 2, 1002.7]]]], tf.float32) scores = tf.constant([[[.9, 0.01], [.75, 0.05], [.6, 0.01], [.95, 0]], [[.5, 0.01], [.3, 0.01], [.01, .85], [.01, .5]]]) clip_window = tf.constant([[0., 0., 5., 5.], [0., 0., 200., 200.]]) score_thresh = 0.1 iou_thresh = .5 max_output_size = 4 exp_nms_corners = np.array([[[0, 0, 1, 1], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]], [[0, 10.1, 1, 11.1], [0, 100, 1, 101], [0, 0, 0, 0], [0, 0, 0, 0]]]) exp_nms_scores = np.array([[.9, 0., 0., 0.], [.5, .3, 0, 0]]) exp_nms_classes = np.array([[0, 0, 0, 0], [0, 0, 0, 0]]) (nmsed_boxes, nmsed_scores, nmsed_classes, nmsed_masks, nmsed_additional_fields, num_detections ) = post_processing.batch_multiclass_non_max_suppression( boxes, scores, score_thresh, iou_thresh, max_size_per_class=max_output_size, max_total_size=max_output_size, clip_window=clip_window) self.assertIsNone(nmsed_masks) self.assertIsNone(nmsed_additional_fields) # Check static shapes self.assertAllEqual(nmsed_boxes.shape.as_list(), exp_nms_corners.shape) self.assertAllEqual(nmsed_scores.shape.as_list(), exp_nms_scores.shape) self.assertAllEqual(nmsed_classes.shape.as_list(), exp_nms_classes.shape) self.assertEqual(num_detections.shape.as_list(), [2]) with self.test_session() as sess: (nmsed_boxes, nmsed_scores, nmsed_classes, num_detections) = sess.run([nmsed_boxes, nmsed_scores, nmsed_classes, num_detections]) self.assertAllClose(nmsed_boxes, exp_nms_corners) self.assertAllClose(nmsed_scores, exp_nms_scores) self.assertAllClose(nmsed_classes, exp_nms_classes) self.assertAllClose(num_detections, [1, 2]) def test_batch_multiclass_nms_with_masks(self): boxes = tf.constant([[[[0, 0, 1, 1], [0, 0, 4, 5]], [[0, 0.1, 1, 1.1], [0, 0.1, 2, 1.1]], [[0, -0.1, 1, 0.9], [0, -0.1, 1, 0.9]], [[0, 10, 1, 11], [0, 10, 1, 11]]], [[[0, 10.1, 1, 11.1], [0, 10.1, 1, 11.1]], [[0, 100, 1, 101], [0, 100, 1, 101]], [[0, 1000, 1, 1002], [0, 999, 2, 1004]], [[0, 1000, 1, 1002.1], [0, 999, 2, 1002.7]]]], tf.float32) scores = tf.constant([[[.9, 0.01], [.75, 0.05], [.6, 0.01], [.95, 0]], [[.5, 0.01], [.3, 0.01], [.01, .85], [.01, .5]]]) masks = tf.constant([[[[[0, 1], [2, 3]], [[1, 2], [3, 4]]], [[[2, 3], [4, 5]], [[3, 4], [5, 6]]], [[[4, 5], [6, 7]], [[5, 6], [7, 8]]], [[[6, 7], [8, 9]], [[7, 8], [9, 10]]]], [[[[8, 9], [10, 11]], [[9, 10], [11, 12]]], [[[10, 11], [12, 13]], [[11, 12], [13, 14]]], [[[12, 13], [14, 15]], [[13, 14], [15, 16]]], [[[14, 15], [16, 17]], [[15, 16], [17, 18]]]]], tf.float32) score_thresh = 0.1 iou_thresh = .5 max_output_size = 4 exp_nms_corners = np.array([[[0, 10, 1, 11], [0, 0, 1, 1], [0, 0, 0, 0], [0, 0, 0, 0]], [[0, 999, 2, 1004], [0, 10.1, 1, 11.1], [0, 100, 1, 101], [0, 0, 0, 0]]]) exp_nms_scores = np.array([[.95, .9, 0, 0], [.85, .5, .3, 0]]) exp_nms_classes = np.array([[0, 0, 0, 0], [1, 0, 0, 0]]) exp_nms_masks = np.array([[[[6, 7], [8, 9]], [[0, 1], [2, 3]], [[0, 0], [0, 0]], [[0, 0], [0, 0]]], [[[13, 14], [15, 16]], [[8, 9], [10, 11]], [[10, 11], [12, 13]], [[0, 0], [0, 0]]]]) (nmsed_boxes, nmsed_scores, nmsed_classes, nmsed_masks, nmsed_additional_fields, num_detections ) = post_processing.batch_multiclass_non_max_suppression( boxes, scores, score_thresh, iou_thresh, max_size_per_class=max_output_size, max_total_size=max_output_size, masks=masks) self.assertIsNone(nmsed_additional_fields) # Check static shapes self.assertAllEqual(nmsed_boxes.shape.as_list(), exp_nms_corners.shape) self.assertAllEqual(nmsed_scores.shape.as_list(), exp_nms_scores.shape) self.assertAllEqual(nmsed_classes.shape.as_list(), exp_nms_classes.shape) self.assertAllEqual(nmsed_masks.shape.as_list(), exp_nms_masks.shape) self.assertEqual(num_detections.shape.as_list(), [2]) with self.test_session() as sess: (nmsed_boxes, nmsed_scores, nmsed_classes, nmsed_masks, num_detections) = sess.run([nmsed_boxes, nmsed_scores, nmsed_classes, nmsed_masks, num_detections]) self.assertAllClose(nmsed_boxes, exp_nms_corners) self.assertAllClose(nmsed_scores, exp_nms_scores) self.assertAllClose(nmsed_classes, exp_nms_classes) self.assertAllClose(num_detections, [2, 3]) self.assertAllClose(nmsed_masks, exp_nms_masks) def test_batch_multiclass_nms_with_additional_fields(self): boxes = tf.constant([[[[0, 0, 1, 1], [0, 0, 4, 5]], [[0, 0.1, 1, 1.1], [0, 0.1, 2, 1.1]], [[0, -0.1, 1, 0.9], [0, -0.1, 1, 0.9]], [[0, 10, 1, 11], [0, 10, 1, 11]]], [[[0, 10.1, 1, 11.1], [0, 10.1, 1, 11.1]], [[0, 100, 1, 101], [0, 100, 1, 101]], [[0, 1000, 1, 1002], [0, 999, 2, 1004]], [[0, 1000, 1, 1002.1], [0, 999, 2, 1002.7]]]], tf.float32) scores = tf.constant([[[.9, 0.01], [.75, 0.05], [.6, 0.01], [.95, 0]], [[.5, 0.01], [.3, 0.01], [.01, .85], [.01, .5]]]) additional_fields = { 'keypoints': tf.constant( [[[[6, 7], [8, 9]], [[0, 1], [2, 3]], [[0, 0], [0, 0]], [[0, 0], [0, 0]]], [[[13, 14], [15, 16]], [[8, 9], [10, 11]], [[10, 11], [12, 13]], [[0, 0], [0, 0]]]], tf.float32) } score_thresh = 0.1 iou_thresh = .5 max_output_size = 4 exp_nms_corners = np.array([[[0, 10, 1, 11], [0, 0, 1, 1], [0, 0, 0, 0], [0, 0, 0, 0]], [[0, 999, 2, 1004], [0, 10.1, 1, 11.1], [0, 100, 1, 101], [0, 0, 0, 0]]]) exp_nms_scores = np.array([[.95, .9, 0, 0], [.85, .5, .3, 0]]) exp_nms_classes = np.array([[0, 0, 0, 0], [1, 0, 0, 0]]) exp_nms_additional_fields = { 'keypoints': np.array([[[[0, 0], [0, 0]], [[6, 7], [8, 9]], [[0, 0], [0, 0]], [[0, 0], [0, 0]]], [[[10, 11], [12, 13]], [[13, 14], [15, 16]], [[8, 9], [10, 11]], [[0, 0], [0, 0]]]]) } (nmsed_boxes, nmsed_scores, nmsed_classes, nmsed_masks, nmsed_additional_fields, num_detections ) = post_processing.batch_multiclass_non_max_suppression( boxes, scores, score_thresh, iou_thresh, max_size_per_class=max_output_size, max_total_size=max_output_size, additional_fields=additional_fields) self.assertIsNone(nmsed_masks) # Check static shapes self.assertAllEqual(nmsed_boxes.shape.as_list(), exp_nms_corners.shape) self.assertAllEqual(nmsed_scores.shape.as_list(), exp_nms_scores.shape) self.assertAllEqual(nmsed_classes.shape.as_list(), exp_nms_classes.shape) self.assertEqual(len(nmsed_additional_fields), len(exp_nms_additional_fields)) for key in exp_nms_additional_fields: self.assertAllEqual(nmsed_additional_fields[key].shape.as_list(), exp_nms_additional_fields[key].shape) self.assertEqual(num_detections.shape.as_list(), [2]) with self.test_session() as sess: (nmsed_boxes, nmsed_scores, nmsed_classes, nmsed_additional_fields, num_detections) = sess.run([nmsed_boxes, nmsed_scores, nmsed_classes, nmsed_additional_fields, num_detections]) self.assertAllClose(nmsed_boxes, exp_nms_corners) self.assertAllClose(nmsed_scores, exp_nms_scores) self.assertAllClose(nmsed_classes, exp_nms_classes) for key in exp_nms_additional_fields: self.assertAllClose(nmsed_additional_fields[key], exp_nms_additional_fields[key]) self.assertAllClose(num_detections, [2, 3]) def test_batch_multiclass_nms_with_dynamic_batch_size(self): boxes_placeholder = tf.placeholder(tf.float32, shape=(None, None, 2, 4)) scores_placeholder = tf.placeholder(tf.float32, shape=(None, None, 2)) masks_placeholder = tf.placeholder(tf.float32, shape=(None, None, 2, 2, 2)) boxes = np.array([[[[0, 0, 1, 1], [0, 0, 4, 5]], [[0, 0.1, 1, 1.1], [0, 0.1, 2, 1.1]], [[0, -0.1, 1, 0.9], [0, -0.1, 1, 0.9]], [[0, 10, 1, 11], [0, 10, 1, 11]]], [[[0, 10.1, 1, 11.1], [0, 10.1, 1, 11.1]], [[0, 100, 1, 101], [0, 100, 1, 101]], [[0, 1000, 1, 1002], [0, 999, 2, 1004]], [[0, 1000, 1, 1002.1], [0, 999, 2, 1002.7]]]]) scores = np.array([[[.9, 0.01], [.75, 0.05], [.6, 0.01], [.95, 0]], [[.5, 0.01], [.3, 0.01], [.01, .85], [.01, .5]]]) masks = np.array([[[[[0, 1], [2, 3]], [[1, 2], [3, 4]]], [[[2, 3], [4, 5]], [[3, 4], [5, 6]]], [[[4, 5], [6, 7]], [[5, 6], [7, 8]]], [[[6, 7], [8, 9]], [[7, 8], [9, 10]]]], [[[[8, 9], [10, 11]], [[9, 10], [11, 12]]], [[[10, 11], [12, 13]], [[11, 12], [13, 14]]], [[[12, 13], [14, 15]], [[13, 14], [15, 16]]], [[[14, 15], [16, 17]], [[15, 16], [17, 18]]]]]) score_thresh = 0.1 iou_thresh = .5 max_output_size = 4 exp_nms_corners = np.array([[[0, 10, 1, 11], [0, 0, 1, 1], [0, 0, 0, 0], [0, 0, 0, 0]], [[0, 999, 2, 1004], [0, 10.1, 1, 11.1], [0, 100, 1, 101], [0, 0, 0, 0]]]) exp_nms_scores = np.array([[.95, .9, 0, 0], [.85, .5, .3, 0]]) exp_nms_classes = np.array([[0, 0, 0, 0], [1, 0, 0, 0]]) exp_nms_masks = np.array([[[[6, 7], [8, 9]], [[0, 1], [2, 3]], [[0, 0], [0, 0]], [[0, 0], [0, 0]]], [[[13, 14], [15, 16]], [[8, 9], [10, 11]], [[10, 11], [12, 13]], [[0, 0], [0, 0]]]]) (nmsed_boxes, nmsed_scores, nmsed_classes, nmsed_masks, nmsed_additional_fields, num_detections ) = post_processing.batch_multiclass_non_max_suppression( boxes_placeholder, scores_placeholder, score_thresh, iou_thresh, max_size_per_class=max_output_size, max_total_size=max_output_size, masks=masks_placeholder) self.assertIsNone(nmsed_additional_fields) # Check static shapes self.assertAllEqual(nmsed_boxes.shape.as_list(), [None, 4, 4]) self.assertAllEqual(nmsed_scores.shape.as_list(), [None, 4]) self.assertAllEqual(nmsed_classes.shape.as_list(), [None, 4]) self.assertAllEqual(nmsed_masks.shape.as_list(), [None, 4, 2, 2]) self.assertEqual(num_detections.shape.as_list(), [None]) with self.test_session() as sess: (nmsed_boxes, nmsed_scores, nmsed_classes, nmsed_masks, num_detections) = sess.run([nmsed_boxes, nmsed_scores, nmsed_classes, nmsed_masks, num_detections], feed_dict={boxes_placeholder: boxes, scores_placeholder: scores, masks_placeholder: masks}) self.assertAllClose(nmsed_boxes, exp_nms_corners) self.assertAllClose(nmsed_scores, exp_nms_scores) self.assertAllClose(nmsed_classes, exp_nms_classes) self.assertAllClose(num_detections, [2, 3]) self.assertAllClose(nmsed_masks, exp_nms_masks) def test_batch_multiclass_nms_with_masks_and_num_valid_boxes(self): boxes = tf.constant([[[[0, 0, 1, 1], [0, 0, 4, 5]], [[0, 0.1, 1, 1.1], [0, 0.1, 2, 1.1]], [[0, -0.1, 1, 0.9], [0, -0.1, 1, 0.9]], [[0, 10, 1, 11], [0, 10, 1, 11]]], [[[0, 10.1, 1, 11.1], [0, 10.1, 1, 11.1]], [[0, 100, 1, 101], [0, 100, 1, 101]], [[0, 1000, 1, 1002], [0, 999, 2, 1004]], [[0, 1000, 1, 1002.1], [0, 999, 2, 1002.7]]]], tf.float32) scores = tf.constant([[[.9, 0.01], [.75, 0.05], [.6, 0.01], [.95, 0]], [[.5, 0.01], [.3, 0.01], [.01, .85], [.01, .5]]]) masks = tf.constant([[[[[0, 1], [2, 3]], [[1, 2], [3, 4]]], [[[2, 3], [4, 5]], [[3, 4], [5, 6]]], [[[4, 5], [6, 7]], [[5, 6], [7, 8]]], [[[6, 7], [8, 9]], [[7, 8], [9, 10]]]], [[[[8, 9], [10, 11]], [[9, 10], [11, 12]]], [[[10, 11], [12, 13]], [[11, 12], [13, 14]]], [[[12, 13], [14, 15]], [[13, 14], [15, 16]]], [[[14, 15], [16, 17]], [[15, 16], [17, 18]]]]], tf.float32) num_valid_boxes = tf.constant([1, 1], tf.int32) score_thresh = 0.1 iou_thresh = .5 max_output_size = 4 exp_nms_corners = [[[0, 0, 1, 1], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]], [[0, 10.1, 1, 11.1], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]]] exp_nms_scores = [[.9, 0, 0, 0], [.5, 0, 0, 0]] exp_nms_classes = [[0, 0, 0, 0], [0, 0, 0, 0]] exp_nms_masks = [[[[0, 1], [2, 3]], [[0, 0], [0, 0]], [[0, 0], [0, 0]], [[0, 0], [0, 0]]], [[[8, 9], [10, 11]], [[0, 0], [0, 0]], [[0, 0], [0, 0]], [[0, 0], [0, 0]]]] (nmsed_boxes, nmsed_scores, nmsed_classes, nmsed_masks, nmsed_additional_fields, num_detections ) = post_processing.batch_multiclass_non_max_suppression( boxes, scores, score_thresh, iou_thresh, max_size_per_class=max_output_size, max_total_size=max_output_size, num_valid_boxes=num_valid_boxes, masks=masks) self.assertIsNone(nmsed_additional_fields) with self.test_session() as sess: (nmsed_boxes, nmsed_scores, nmsed_classes, nmsed_masks, num_detections) = sess.run([nmsed_boxes, nmsed_scores, nmsed_classes, nmsed_masks, num_detections]) self.assertAllClose(nmsed_boxes, exp_nms_corners) self.assertAllClose(nmsed_scores, exp_nms_scores) self.assertAllClose(nmsed_classes, exp_nms_classes) self.assertAllClose(num_detections, [1, 1]) self.assertAllClose(nmsed_masks, exp_nms_masks) def test_batch_multiclass_nms_with_additional_fields_and_num_valid_boxes( self): boxes = tf.constant([[[[0, 0, 1, 1], [0, 0, 4, 5]], [[0, 0.1, 1, 1.1], [0, 0.1, 2, 1.1]], [[0, -0.1, 1, 0.9], [0, -0.1, 1, 0.9]], [[0, 10, 1, 11], [0, 10, 1, 11]]], [[[0, 10.1, 1, 11.1], [0, 10.1, 1, 11.1]], [[0, 100, 1, 101], [0, 100, 1, 101]], [[0, 1000, 1, 1002], [0, 999, 2, 1004]], [[0, 1000, 1, 1002.1], [0, 999, 2, 1002.7]]]], tf.float32) scores = tf.constant([[[.9, 0.01], [.75, 0.05], [.6, 0.01], [.95, 0]], [[.5, 0.01], [.3, 0.01], [.01, .85], [.01, .5]]]) additional_fields = { 'keypoints': tf.constant( [[[[6, 7], [8, 9]], [[0, 1], [2, 3]], [[0, 0], [0, 0]], [[0, 0], [0, 0]]], [[[13, 14], [15, 16]], [[8, 9], [10, 11]], [[10, 11], [12, 13]], [[0, 0], [0, 0]]]], tf.float32) } num_valid_boxes = tf.constant([1, 1], tf.int32) score_thresh = 0.1 iou_thresh = .5 max_output_size = 4 exp_nms_corners = [[[0, 0, 1, 1], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]], [[0, 10.1, 1, 11.1], [0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 0, 0]]] exp_nms_scores = [[.9, 0, 0, 0], [.5, 0, 0, 0]] exp_nms_classes = [[0, 0, 0, 0], [0, 0, 0, 0]] exp_nms_additional_fields = { 'keypoints': np.array([[[[6, 7], [8, 9]], [[0, 0], [0, 0]], [[0, 0], [0, 0]], [[0, 0], [0, 0]]], [[[13, 14], [15, 16]], [[0, 0], [0, 0]], [[0, 0], [0, 0]], [[0, 0], [0, 0]]]]) } (nmsed_boxes, nmsed_scores, nmsed_classes, nmsed_masks, nmsed_additional_fields, num_detections ) = post_processing.batch_multiclass_non_max_suppression( boxes, scores, score_thresh, iou_thresh, max_size_per_class=max_output_size, max_total_size=max_output_size, num_valid_boxes=num_valid_boxes, additional_fields=additional_fields) self.assertIsNone(nmsed_masks) with self.test_session() as sess: (nmsed_boxes, nmsed_scores, nmsed_classes, nmsed_additional_fields, num_detections) = sess.run([nmsed_boxes, nmsed_scores, nmsed_classes, nmsed_additional_fields, num_detections]) self.assertAllClose(nmsed_boxes, exp_nms_corners) self.assertAllClose(nmsed_scores, exp_nms_scores) self.assertAllClose(nmsed_classes, exp_nms_classes) for key in exp_nms_additional_fields: self.assertAllClose(nmsed_additional_fields[key], exp_nms_additional_fields[key]) self.assertAllClose(num_detections, [1, 1]) # TODO(bhattad): Remove conditional after CMLE moves to TF 1.9 if __name__ == '__main__': tf.test.main()
TensorFlow/Detection/SSD/models/research/object_detection/metrics
metrics
coco_evaluation
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== """Class for evaluating object detections with COCO metrics.""" import numpy as np import tensorflow as tf from object_detection.core import standard_fields from object_detection.metrics import coco_tools from object_detection.utils import json_utils from object_detection.utils import object_detection_evaluation class CocoDetectionEvaluator(object_detection_evaluation.DetectionEvaluator): """Class to evaluate COCO detection metrics.""" def __init__(self, categories, include_metrics_per_category=False, all_metrics_per_category=False): """Constructor. Args: categories: A list of dicts, each of which has the following keys - 'id': (required) an integer id uniquely identifying this category. 'name': (required) string representing category name e.g., 'cat', 'dog'. include_metrics_per_category: If True, include metrics for each category. all_metrics_per_category: Whether to include all the summary metrics for each category in per_category_ap. Be careful with setting it to true if you have more than handful of categories, because it will pollute your mldash. """ super(CocoDetectionEvaluator, self).__init__(categories) # _image_ids is a dictionary that maps unique image ids to Booleans which # indicate whether a corresponding detection has been added. self._image_ids = {} self._groundtruth_list = [] self._detection_boxes_list = [] self._category_id_set = set([cat['id'] for cat in self._categories]) self._annotation_id = 1 self._metrics = None self._include_metrics_per_category = include_metrics_per_category self._all_metrics_per_category = all_metrics_per_category def clear(self): """Clears the state to prepare for a fresh evaluation.""" self._image_ids.clear() self._groundtruth_list = [] self._detection_boxes_list = [] def add_single_ground_truth_image_info(self, image_id, groundtruth_dict): """Adds groundtruth for a single image to be used for evaluation. If the image has already been added, a warning is logged, and groundtruth is ignored. Args: image_id: A unique string/integer identifier for the image. groundtruth_dict: A dictionary containing - InputDataFields.groundtruth_boxes: float32 numpy array of shape [num_boxes, 4] containing `num_boxes` groundtruth boxes of the format [ymin, xmin, ymax, xmax] in absolute image coordinates. InputDataFields.groundtruth_classes: integer numpy array of shape [num_boxes] containing 1-indexed groundtruth classes for the boxes. InputDataFields.groundtruth_is_crowd (optional): integer numpy array of shape [num_boxes] containing iscrowd flag for groundtruth boxes. """ if image_id in self._image_ids: tf.logging.warning('Ignoring ground truth with image id %s since it was ' 'previously added', image_id) return groundtruth_is_crowd = groundtruth_dict.get( standard_fields.InputDataFields.groundtruth_is_crowd) # Drop groundtruth_is_crowd if empty tensor. if groundtruth_is_crowd is not None and not groundtruth_is_crowd.shape[0]: groundtruth_is_crowd = None self._groundtruth_list.extend( coco_tools.ExportSingleImageGroundtruthToCoco( image_id=image_id, next_annotation_id=self._annotation_id, category_id_set=self._category_id_set, groundtruth_boxes=groundtruth_dict[ standard_fields.InputDataFields.groundtruth_boxes], groundtruth_classes=groundtruth_dict[ standard_fields.InputDataFields.groundtruth_classes], groundtruth_is_crowd=groundtruth_is_crowd)) self._annotation_id += groundtruth_dict[standard_fields.InputDataFields. groundtruth_boxes].shape[0] # Boolean to indicate whether a detection has been added for this image. self._image_ids[image_id] = False def add_single_detected_image_info(self, image_id, detections_dict): """Adds detections for a single image to be used for evaluation. If a detection has already been added for this image id, a warning is logged, and the detection is skipped. Args: image_id: A unique string/integer identifier for the image. detections_dict: A dictionary containing - DetectionResultFields.detection_boxes: float32 numpy array of shape [num_boxes, 4] containing `num_boxes` detection boxes of the format [ymin, xmin, ymax, xmax] in absolute image coordinates. DetectionResultFields.detection_scores: float32 numpy array of shape [num_boxes] containing detection scores for the boxes. DetectionResultFields.detection_classes: integer numpy array of shape [num_boxes] containing 1-indexed detection classes for the boxes. Raises: ValueError: If groundtruth for the image_id is not available. """ if image_id not in self._image_ids: raise ValueError('Missing groundtruth for image id: {}'.format(image_id)) if self._image_ids[image_id]: tf.logging.warning('Ignoring detection with image id %s since it was ' 'previously added', image_id) return self._detection_boxes_list.extend( coco_tools.ExportSingleImageDetectionBoxesToCoco( image_id=image_id, category_id_set=self._category_id_set, detection_boxes=detections_dict[standard_fields. DetectionResultFields .detection_boxes], detection_scores=detections_dict[standard_fields. DetectionResultFields. detection_scores], detection_classes=detections_dict[standard_fields. DetectionResultFields. detection_classes])) self._image_ids[image_id] = True def dump_detections_to_json_file(self, json_output_path): """Saves the detections into json_output_path in the format used by MS COCO. Args: json_output_path: String containing the output file's path. It can be also None. In that case nothing will be written to the output file. """ if json_output_path and json_output_path is not None: with tf.gfile.GFile(json_output_path, 'w') as fid: tf.logging.info('Dumping detections to output json file.') json_utils.Dump( obj=self._detection_boxes_list, fid=fid, float_digits=4, indent=2) def evaluate(self): """Evaluates the detection boxes and returns a dictionary of coco metrics. Returns: A dictionary holding - 1. summary_metrics: 'DetectionBoxes_Precision/mAP': mean average precision over classes averaged over IOU thresholds ranging from .5 to .95 with .05 increments. 'DetectionBoxes_Precision/mAP@.50IOU': mean average precision at 50% IOU 'DetectionBoxes_Precision/mAP@.75IOU': mean average precision at 75% IOU 'DetectionBoxes_Precision/mAP (small)': mean average precision for small objects (area < 32^2 pixels). 'DetectionBoxes_Precision/mAP (medium)': mean average precision for medium sized objects (32^2 pixels < area < 96^2 pixels). 'DetectionBoxes_Precision/mAP (large)': mean average precision for large objects (96^2 pixels < area < 10000^2 pixels). 'DetectionBoxes_Recall/AR@1': average recall with 1 detection. 'DetectionBoxes_Recall/AR@10': average recall with 10 detections. 'DetectionBoxes_Recall/AR@100': average recall with 100 detections. 'DetectionBoxes_Recall/AR@100 (small)': average recall for small objects with 100. 'DetectionBoxes_Recall/AR@100 (medium)': average recall for medium objects with 100. 'DetectionBoxes_Recall/AR@100 (large)': average recall for large objects with 100 detections. 2. per_category_ap: if include_metrics_per_category is True, category specific results with keys of the form: 'Precision mAP ByCategory/category' (without the supercategory part if no supercategories exist). For backward compatibility 'PerformanceByCategory' is included in the output regardless of all_metrics_per_category. """ groundtruth_dict = { 'annotations': self._groundtruth_list, 'images': [{'id': image_id} for image_id in self._image_ids], 'categories': self._categories } coco_wrapped_groundtruth = coco_tools.COCOWrapper(groundtruth_dict) coco_wrapped_detections = coco_wrapped_groundtruth.LoadAnnotations( self._detection_boxes_list) box_evaluator = coco_tools.COCOEvalWrapper( coco_wrapped_groundtruth, coco_wrapped_detections, agnostic_mode=False) box_metrics, box_per_category_ap = box_evaluator.ComputeMetrics( include_metrics_per_category=self._include_metrics_per_category, all_metrics_per_category=self._all_metrics_per_category) box_metrics.update(box_per_category_ap) box_metrics = {'DetectionBoxes_'+ key: value for key, value in iter(box_metrics.items())} return box_metrics def get_estimator_eval_metric_ops(self, eval_dict): """Returns a dictionary of eval metric ops. Note that once value_op is called, the detections and groundtruth added via update_op are cleared. This function can take in groundtruth and detections for a batch of images, or for a single image. For the latter case, the batch dimension for input tensors need not be present. Args: eval_dict: A dictionary that holds tensors for evaluating object detection performance. For single-image evaluation, this dictionary may be produced from eval_util.result_dict_for_single_example(). If multi-image evaluation, `eval_dict` should contain the fields 'num_groundtruth_boxes_per_image' and 'num_det_boxes_per_image' to properly unpad the tensors from the batch. Returns: a dictionary of metric names to tuple of value_op and update_op that can be used as eval metric ops in tf.estimator.EstimatorSpec. Note that all update ops must be run together and similarly all value ops must be run together to guarantee correct behaviour. """ def update_op( image_id_batched, groundtruth_boxes_batched, groundtruth_classes_batched, groundtruth_is_crowd_batched, num_gt_boxes_per_image, detection_boxes_batched, detection_scores_batched, detection_classes_batched, num_det_boxes_per_image, is_annotated_batched): """Update operation for adding batch of images to Coco evaluator.""" for (image_id, gt_box, gt_class, gt_is_crowd, num_gt_box, det_box, det_score, det_class, num_det_box, is_annotated) in zip( image_id_batched, groundtruth_boxes_batched, groundtruth_classes_batched, groundtruth_is_crowd_batched, num_gt_boxes_per_image, detection_boxes_batched, detection_scores_batched, detection_classes_batched, num_det_boxes_per_image, is_annotated_batched): if is_annotated: self.add_single_ground_truth_image_info( image_id, { 'groundtruth_boxes': gt_box[:num_gt_box], 'groundtruth_classes': gt_class[:num_gt_box], 'groundtruth_is_crowd': gt_is_crowd[:num_gt_box] }) self.add_single_detected_image_info( image_id, {'detection_boxes': det_box[:num_det_box], 'detection_scores': det_score[:num_det_box], 'detection_classes': det_class[:num_det_box]}) # Unpack items from the evaluation dictionary. input_data_fields = standard_fields.InputDataFields detection_fields = standard_fields.DetectionResultFields image_id = eval_dict[input_data_fields.key] groundtruth_boxes = eval_dict[input_data_fields.groundtruth_boxes] groundtruth_classes = eval_dict[input_data_fields.groundtruth_classes] groundtruth_is_crowd = eval_dict.get( input_data_fields.groundtruth_is_crowd, None) detection_boxes = eval_dict[detection_fields.detection_boxes] detection_scores = eval_dict[detection_fields.detection_scores] detection_classes = eval_dict[detection_fields.detection_classes] num_gt_boxes_per_image = eval_dict.get( 'num_groundtruth_boxes_per_image', None) num_det_boxes_per_image = eval_dict.get('num_det_boxes_per_image', None) is_annotated = eval_dict.get('is_annotated', None) if groundtruth_is_crowd is None: groundtruth_is_crowd = tf.zeros_like(groundtruth_classes, dtype=tf.bool) if not image_id.shape.as_list(): # Apply a batch dimension to all tensors. image_id = tf.expand_dims(image_id, 0) groundtruth_boxes = tf.expand_dims(groundtruth_boxes, 0) groundtruth_classes = tf.expand_dims(groundtruth_classes, 0) groundtruth_is_crowd = tf.expand_dims(groundtruth_is_crowd, 0) detection_boxes = tf.expand_dims(detection_boxes, 0) detection_scores = tf.expand_dims(detection_scores, 0) detection_classes = tf.expand_dims(detection_classes, 0) if num_gt_boxes_per_image is None: num_gt_boxes_per_image = tf.shape(groundtruth_boxes)[1:2] else: num_gt_boxes_per_image = tf.expand_dims(num_gt_boxes_per_image, 0) if num_det_boxes_per_image is None: num_det_boxes_per_image = tf.shape(detection_boxes)[1:2] else: num_det_boxes_per_image = tf.expand_dims(num_det_boxes_per_image, 0) if is_annotated is None: is_annotated = tf.constant([True]) else: is_annotated = tf.expand_dims(is_annotated, 0) else: if num_gt_boxes_per_image is None: num_gt_boxes_per_image = tf.tile( tf.shape(groundtruth_boxes)[1:2], multiples=tf.shape(groundtruth_boxes)[0:1]) if num_det_boxes_per_image is None: num_det_boxes_per_image = tf.tile( tf.shape(detection_boxes)[1:2], multiples=tf.shape(detection_boxes)[0:1]) if is_annotated is None: is_annotated = tf.ones_like(image_id, dtype=tf.bool) update_op = tf.py_func(update_op, [image_id, groundtruth_boxes, groundtruth_classes, groundtruth_is_crowd, num_gt_boxes_per_image, detection_boxes, detection_scores, detection_classes, num_det_boxes_per_image, is_annotated], []) metric_names = ['DetectionBoxes_Precision/mAP', 'DetectionBoxes_Precision/mAP@.50IOU', 'DetectionBoxes_Precision/mAP@.75IOU', 'DetectionBoxes_Precision/mAP (large)', 'DetectionBoxes_Precision/mAP (medium)', 'DetectionBoxes_Precision/mAP (small)', 'DetectionBoxes_Recall/AR@1', 'DetectionBoxes_Recall/AR@10', 'DetectionBoxes_Recall/AR@100', 'DetectionBoxes_Recall/AR@100 (large)', 'DetectionBoxes_Recall/AR@100 (medium)', 'DetectionBoxes_Recall/AR@100 (small)'] if self._include_metrics_per_category: for category_dict in self._categories: metric_names.append('DetectionBoxes_PerformanceByCategory/mAP/' + category_dict['name']) def first_value_func(): self._metrics = self.evaluate() self.clear() return np.float32(self._metrics[metric_names[0]]) def value_func_factory(metric_name): def value_func(): return np.float32(self._metrics[metric_name]) return value_func # Ensure that the metrics are only evaluated once. first_value_op = tf.py_func(first_value_func, [], tf.float32) eval_metric_ops = {metric_names[0]: (first_value_op, update_op)} with tf.control_dependencies([first_value_op]): for metric_name in metric_names[1:]: eval_metric_ops[metric_name] = (tf.py_func( value_func_factory(metric_name), [], np.float32), update_op) return eval_metric_ops def _check_mask_type_and_value(array_name, masks): """Checks whether mask dtype is uint8 and the values are either 0 or 1.""" if masks.dtype != np.uint8: raise ValueError('{} must be of type np.uint8. Found {}.'.format( array_name, masks.dtype)) if np.any(np.logical_and(masks != 0, masks != 1)): raise ValueError('{} elements can only be either 0 or 1.'.format( array_name)) class CocoMaskEvaluator(object_detection_evaluation.DetectionEvaluator): """Class to evaluate COCO detection metrics.""" def __init__(self, categories, include_metrics_per_category=False): """Constructor. Args: categories: A list of dicts, each of which has the following keys - 'id': (required) an integer id uniquely identifying this category. 'name': (required) string representing category name e.g., 'cat', 'dog'. include_metrics_per_category: If True, include metrics for each category. """ super(CocoMaskEvaluator, self).__init__(categories) self._image_id_to_mask_shape_map = {} self._image_ids_with_detections = set([]) self._groundtruth_list = [] self._detection_masks_list = [] self._category_id_set = set([cat['id'] for cat in self._categories]) self._annotation_id = 1 self._include_metrics_per_category = include_metrics_per_category def clear(self): """Clears the state to prepare for a fresh evaluation.""" self._image_id_to_mask_shape_map.clear() self._image_ids_with_detections.clear() self._groundtruth_list = [] self._detection_masks_list = [] def add_single_ground_truth_image_info(self, image_id, groundtruth_dict): """Adds groundtruth for a single image to be used for evaluation. If the image has already been added, a warning is logged, and groundtruth is ignored. Args: image_id: A unique string/integer identifier for the image. groundtruth_dict: A dictionary containing - InputDataFields.groundtruth_boxes: float32 numpy array of shape [num_boxes, 4] containing `num_boxes` groundtruth boxes of the format [ymin, xmin, ymax, xmax] in absolute image coordinates. InputDataFields.groundtruth_classes: integer numpy array of shape [num_boxes] containing 1-indexed groundtruth classes for the boxes. InputDataFields.groundtruth_instance_masks: uint8 numpy array of shape [num_boxes, image_height, image_width] containing groundtruth masks corresponding to the boxes. The elements of the array must be in {0, 1}. """ if image_id in self._image_id_to_mask_shape_map: tf.logging.warning('Ignoring ground truth with image id %s since it was ' 'previously added', image_id) return groundtruth_instance_masks = groundtruth_dict[ standard_fields.InputDataFields.groundtruth_instance_masks] _check_mask_type_and_value(standard_fields.InputDataFields. groundtruth_instance_masks, groundtruth_instance_masks) self._groundtruth_list.extend( coco_tools. ExportSingleImageGroundtruthToCoco( image_id=image_id, next_annotation_id=self._annotation_id, category_id_set=self._category_id_set, groundtruth_boxes=groundtruth_dict[standard_fields.InputDataFields. groundtruth_boxes], groundtruth_classes=groundtruth_dict[standard_fields. InputDataFields. groundtruth_classes], groundtruth_masks=groundtruth_instance_masks)) self._annotation_id += groundtruth_dict[standard_fields.InputDataFields. groundtruth_boxes].shape[0] self._image_id_to_mask_shape_map[image_id] = groundtruth_dict[ standard_fields.InputDataFields.groundtruth_instance_masks].shape def add_single_detected_image_info(self, image_id, detections_dict): """Adds detections for a single image to be used for evaluation. If a detection has already been added for this image id, a warning is logged, and the detection is skipped. Args: image_id: A unique string/integer identifier for the image. detections_dict: A dictionary containing - DetectionResultFields.detection_scores: float32 numpy array of shape [num_boxes] containing detection scores for the boxes. DetectionResultFields.detection_classes: integer numpy array of shape [num_boxes] containing 1-indexed detection classes for the boxes. DetectionResultFields.detection_masks: optional uint8 numpy array of shape [num_boxes, image_height, image_width] containing instance masks corresponding to the boxes. The elements of the array must be in {0, 1}. Raises: ValueError: If groundtruth for the image_id is not available or if spatial shapes of groundtruth_instance_masks and detection_masks are incompatible. """ if image_id not in self._image_id_to_mask_shape_map: raise ValueError('Missing groundtruth for image id: {}'.format(image_id)) if image_id in self._image_ids_with_detections: tf.logging.warning('Ignoring detection with image id %s since it was ' 'previously added', image_id) return groundtruth_masks_shape = self._image_id_to_mask_shape_map[image_id] detection_masks = detections_dict[standard_fields.DetectionResultFields. detection_masks] if groundtruth_masks_shape[1:] != detection_masks.shape[1:]: raise ValueError('Spatial shape of groundtruth masks and detection masks ' 'are incompatible: {} vs {}'.format( groundtruth_masks_shape, detection_masks.shape)) _check_mask_type_and_value(standard_fields.DetectionResultFields. detection_masks, detection_masks) self._detection_masks_list.extend( coco_tools.ExportSingleImageDetectionMasksToCoco( image_id=image_id, category_id_set=self._category_id_set, detection_masks=detection_masks, detection_scores=detections_dict[standard_fields. DetectionResultFields. detection_scores], detection_classes=detections_dict[standard_fields. DetectionResultFields. detection_classes])) self._image_ids_with_detections.update([image_id]) def dump_detections_to_json_file(self, json_output_path): """Saves the detections into json_output_path in the format used by MS COCO. Args: json_output_path: String containing the output file's path. It can be also None. In that case nothing will be written to the output file. """ if json_output_path and json_output_path is not None: tf.logging.info('Dumping detections to output json file.') with tf.gfile.GFile(json_output_path, 'w') as fid: json_utils.Dump( obj=self._detection_masks_list, fid=fid, float_digits=4, indent=2) def evaluate(self): """Evaluates the detection masks and returns a dictionary of coco metrics. Returns: A dictionary holding - 1. summary_metrics: 'DetectionMasks_Precision/mAP': mean average precision over classes averaged over IOU thresholds ranging from .5 to .95 with .05 increments. 'DetectionMasks_Precision/mAP@.50IOU': mean average precision at 50% IOU. 'DetectionMasks_Precision/mAP@.75IOU': mean average precision at 75% IOU. 'DetectionMasks_Precision/mAP (small)': mean average precision for small objects (area < 32^2 pixels). 'DetectionMasks_Precision/mAP (medium)': mean average precision for medium sized objects (32^2 pixels < area < 96^2 pixels). 'DetectionMasks_Precision/mAP (large)': mean average precision for large objects (96^2 pixels < area < 10000^2 pixels). 'DetectionMasks_Recall/AR@1': average recall with 1 detection. 'DetectionMasks_Recall/AR@10': average recall with 10 detections. 'DetectionMasks_Recall/AR@100': average recall with 100 detections. 'DetectionMasks_Recall/AR@100 (small)': average recall for small objects with 100 detections. 'DetectionMasks_Recall/AR@100 (medium)': average recall for medium objects with 100 detections. 'DetectionMasks_Recall/AR@100 (large)': average recall for large objects with 100 detections. 2. per_category_ap: if include_metrics_per_category is True, category specific results with keys of the form: 'Precision mAP ByCategory/category' (without the supercategory part if no supercategories exist). For backward compatibility 'PerformanceByCategory' is included in the output regardless of all_metrics_per_category. """ groundtruth_dict = { 'annotations': self._groundtruth_list, 'images': [{'id': image_id, 'height': shape[1], 'width': shape[2]} for image_id, shape in self._image_id_to_mask_shape_map. iteritems()], 'categories': self._categories } coco_wrapped_groundtruth = coco_tools.COCOWrapper( groundtruth_dict, detection_type='segmentation') coco_wrapped_detection_masks = coco_wrapped_groundtruth.LoadAnnotations( self._detection_masks_list) mask_evaluator = coco_tools.COCOEvalWrapper( coco_wrapped_groundtruth, coco_wrapped_detection_masks, agnostic_mode=False, iou_type='segm') mask_metrics, mask_per_category_ap = mask_evaluator.ComputeMetrics( include_metrics_per_category=self._include_metrics_per_category) mask_metrics.update(mask_per_category_ap) mask_metrics = {'DetectionMasks_'+ key: value for key, value in mask_metrics.iteritems()} return mask_metrics def get_estimator_eval_metric_ops(self, eval_dict): """Returns a dictionary of eval metric ops. Note that once value_op is called, the detections and groundtruth added via update_op are cleared. Args: eval_dict: A dictionary that holds tensors for evaluating object detection performance. For single-image evaluation, this dictionary may be produced from eval_util.result_dict_for_single_example(). If multi-image evaluation, `eval_dict` should contain the fields 'num_groundtruth_boxes_per_image' and 'num_det_boxes_per_image' to properly unpad the tensors from the batch. Returns: a dictionary of metric names to tuple of value_op and update_op that can be used as eval metric ops in tf.estimator.EstimatorSpec. Note that all update ops must be run together and similarly all value ops must be run together to guarantee correct behaviour. """ def update_op(image_id_batched, groundtruth_boxes_batched, groundtruth_classes_batched, groundtruth_instance_masks_batched, groundtruth_is_crowd_batched, num_gt_boxes_per_image, detection_scores_batched, detection_classes_batched, detection_masks_batched, num_det_boxes_per_image): """Update op for metrics.""" for (image_id, groundtruth_boxes, groundtruth_classes, groundtruth_instance_masks, groundtruth_is_crowd, num_gt_box, detection_scores, detection_classes, detection_masks, num_det_box) in zip( image_id_batched, groundtruth_boxes_batched, groundtruth_classes_batched, groundtruth_instance_masks_batched, groundtruth_is_crowd_batched, num_gt_boxes_per_image, detection_scores_batched, detection_classes_batched, detection_masks_batched, num_det_boxes_per_image): self.add_single_ground_truth_image_info( image_id, { 'groundtruth_boxes': groundtruth_boxes[:num_gt_box], 'groundtruth_classes': groundtruth_classes[:num_gt_box], 'groundtruth_instance_masks': groundtruth_instance_masks[:num_gt_box], 'groundtruth_is_crowd': groundtruth_is_crowd[:num_gt_box] }) self.add_single_detected_image_info( image_id, { 'detection_scores': detection_scores[:num_det_box], 'detection_classes': detection_classes[:num_det_box], 'detection_masks': detection_masks[:num_det_box] }) # Unpack items from the evaluation dictionary. input_data_fields = standard_fields.InputDataFields detection_fields = standard_fields.DetectionResultFields image_id = eval_dict[input_data_fields.key] groundtruth_boxes = eval_dict[input_data_fields.groundtruth_boxes] groundtruth_classes = eval_dict[input_data_fields.groundtruth_classes] groundtruth_instance_masks = eval_dict[ input_data_fields.groundtruth_instance_masks] groundtruth_is_crowd = eval_dict.get( input_data_fields.groundtruth_is_crowd, None) num_gt_boxes_per_image = eval_dict.get( input_data_fields.num_groundtruth_boxes, None) detection_scores = eval_dict[detection_fields.detection_scores] detection_classes = eval_dict[detection_fields.detection_classes] detection_masks = eval_dict[detection_fields.detection_masks] num_det_boxes_per_image = eval_dict.get(detection_fields.num_detections, None) if groundtruth_is_crowd is None: groundtruth_is_crowd = tf.zeros_like(groundtruth_classes, dtype=tf.bool) if not image_id.shape.as_list(): # Apply a batch dimension to all tensors. image_id = tf.expand_dims(image_id, 0) groundtruth_boxes = tf.expand_dims(groundtruth_boxes, 0) groundtruth_classes = tf.expand_dims(groundtruth_classes, 0) groundtruth_instance_masks = tf.expand_dims(groundtruth_instance_masks, 0) groundtruth_is_crowd = tf.expand_dims(groundtruth_is_crowd, 0) detection_scores = tf.expand_dims(detection_scores, 0) detection_classes = tf.expand_dims(detection_classes, 0) detection_masks = tf.expand_dims(detection_masks, 0) if num_gt_boxes_per_image is None: num_gt_boxes_per_image = tf.shape(groundtruth_boxes)[1:2] else: num_gt_boxes_per_image = tf.expand_dims(num_gt_boxes_per_image, 0) if num_det_boxes_per_image is None: num_det_boxes_per_image = tf.shape(detection_scores)[1:2] else: num_det_boxes_per_image = tf.expand_dims(num_det_boxes_per_image, 0) else: if num_gt_boxes_per_image is None: num_gt_boxes_per_image = tf.tile( tf.shape(groundtruth_boxes)[1:2], multiples=tf.shape(groundtruth_boxes)[0:1]) if num_det_boxes_per_image is None: num_det_boxes_per_image = tf.tile( tf.shape(detection_scores)[1:2], multiples=tf.shape(detection_scores)[0:1]) update_op = tf.py_func(update_op, [ image_id, groundtruth_boxes, groundtruth_classes, groundtruth_instance_masks, groundtruth_is_crowd, num_gt_boxes_per_image, detection_scores, detection_classes, detection_masks, num_det_boxes_per_image ], []) metric_names = ['DetectionMasks_Precision/mAP', 'DetectionMasks_Precision/mAP@.50IOU', 'DetectionMasks_Precision/mAP@.75IOU', 'DetectionMasks_Precision/mAP (large)', 'DetectionMasks_Precision/mAP (medium)', 'DetectionMasks_Precision/mAP (small)', 'DetectionMasks_Recall/AR@1', 'DetectionMasks_Recall/AR@10', 'DetectionMasks_Recall/AR@100', 'DetectionMasks_Recall/AR@100 (large)', 'DetectionMasks_Recall/AR@100 (medium)', 'DetectionMasks_Recall/AR@100 (small)'] if self._include_metrics_per_category: for category_dict in self._categories: metric_names.append('DetectionMasks_PerformanceByCategory/mAP/' + category_dict['name']) def first_value_func(): self._metrics = self.evaluate() self.clear() return np.float32(self._metrics[metric_names[0]]) def value_func_factory(metric_name): def value_func(): return np.float32(self._metrics[metric_name]) return value_func # Ensure that the metrics are only evaluated once. first_value_op = tf.py_func(first_value_func, [], tf.float32) eval_metric_ops = {metric_names[0]: (first_value_op, update_op)} with tf.control_dependencies([first_value_op]): for metric_name in metric_names[1:]: eval_metric_ops[metric_name] = (tf.py_func( value_func_factory(metric_name), [], np.float32), update_op) return eval_metric_ops
TensorFlow2/Segmentation/UNet_Medical/examples
examples
unet_TRAIN_SINGLE
# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # This script launches U-Net run in FP32 and trains for 6400 iterations with batch_size 8. Usage: # bash unet_TRAIN_SINGLE.sh <number of gpus> <path to dataset> <path to results directory> horovodrun -np $1 python main.py --data_dir $2 --model_dir $3 --log_every 100 --max_steps 6400 --batch_size 8 --exec_mode train_and_evaluate --fold 0 --augment --xla --log_dir $3/log.json
PyTorch/Segmentation/MaskRCNN/pytorch/configs/quick_schedules
quick_schedules
e2e_faster_rcnn_R_50_FPN_quick
MODEL: META_ARCHITECTURE: "GeneralizedRCNN" WEIGHT: "catalog://ImageNetPretrained/MSRA/R-50" BACKBONE: CONV_BODY: "R-50-FPN" OUT_CHANNELS: 256 RPN: USE_FPN: True ANCHOR_STRIDE: (4, 8, 16, 32, 64) PRE_NMS_TOP_N_TRAIN: 2000 PRE_NMS_TOP_N_TEST: 1000 POST_NMS_TOP_N_TEST: 1000 FPN_POST_NMS_TOP_N_TEST: 1000 ROI_HEADS: USE_FPN: True BATCH_SIZE_PER_IMAGE: 256 ROI_BOX_HEAD: POOLER_RESOLUTION: 7 POOLER_SCALES: (0.25, 0.125, 0.0625, 0.03125) POOLER_SAMPLING_RATIO: 2 FEATURE_EXTRACTOR: "FPN2MLPFeatureExtractor" PREDICTOR: "FPNPredictor" DATASETS: TRAIN: ("coco_2014_minival",) TEST: ("coco_2014_minival",) INPUT: MIN_SIZE_TRAIN: 600 MAX_SIZE_TRAIN: 1000 MIN_SIZE_TEST: 800 MAX_SIZE_TEST: 1000 DATALOADER: SIZE_DIVISIBILITY: 32 SOLVER: BASE_LR: 0.005 WEIGHT_DECAY: 0.0001 STEPS: (1500,) MAX_ITER: 2000 IMS_PER_BATCH: 4 TEST: IMS_PER_BATCH: 2
PyTorch/SpeechSynthesis/HiFiGAN/scripts
scripts
train_lj22khz
#!/usr/bin/env bash export OMP_NUM_THREADS=1 # Enables faster cuDNN kernels (available since the 21.12-py3 NGC container) export CUDNN_V8_API_ENABLED=1 # Keep the flag for older containers export TORCH_CUDNN_V8_API_ENABLED=1 : ${NUM_GPUS:=8} : ${BATCH_SIZE:=16} : ${AMP:=false} : ${EPOCHS:=6500} : ${OUTPUT_DIR:="results/hifigan_lj22khz"} : ${LOG_FILE:=$OUTPUT_DIR/nvlog.json} : ${DATASET_DIR:="data/LJSpeech-1.1"} : ${TRAIN_FILELIST:="data/filelists/ljs_audio_train.txt"} : ${VAL_FILELIST:="data/filelists/ljs_audio_val.txt"} # Intervals are specified in # of epochs : ${VAL_INTERVAL:=10} : ${SAMPLES_INTERVAL:=100} : ${CHECKPOINT_INTERVAL:=10} : ${LEARNING_RATE:=0.0003} : ${LEARNING_RATE_DECAY:=0.9998} : ${GRAD_ACCUMULATION:=1} : ${RESUME:=true} : ${FINE_TUNE_DIR:=""} mkdir -p "$OUTPUT_DIR" # Adjust env variables to maintain the global batch size: # NUM_GPUS x BATCH_SIZE x GRAD_ACCUMULATION = 128 GBS=$(($NUM_GPUS * $BATCH_SIZE * $GRAD_ACCUMULATION)) [ $GBS -ne 128 ] && echo -e "\nWARNING: Global batch size changed from 128 to ${GBS}." echo -e "\nAMP=$AMP, ${NUM_GPUS}x${BATCH_SIZE}x${GRAD_ACCUMULATION}" \ "(global batch size ${GBS})\n" ARGS+=" --cuda" ARGS+=" --dataset_path $DATASET_DIR" ARGS+=" --training_files $TRAIN_FILELIST" ARGS+=" --validation_files $VAL_FILELIST" ARGS+=" --output $OUTPUT_DIR" ARGS+=" --checkpoint_interval $CHECKPOINT_INTERVAL" ARGS+=" --epochs $EPOCHS" ARGS+=" --batch_size $BATCH_SIZE" ARGS+=" --learning_rate $LEARNING_RATE" ARGS+=" --lr_decay $LEARNING_RATE_DECAY" ARGS+=" --validation_interval $VAL_INTERVAL" ARGS+=" --samples_interval $SAMPLES_INTERVAL" [ "$AMP" = true ] && ARGS+=" --amp" [ "$FINE_TUNE_DIR" != "" ] && ARGS+=" --input_mels_dir $FINE_TUNE_DIR" [ "$FINE_TUNE_DIR" != "" ] && ARGS+=" --fine_tuning" [ -n "$FINE_TUNE_LR_FACTOR" ] && ARGS+=" --fine_tune_lr_factor $FINE_TUNE_LR_FACTOR" [ -n "$EPOCHS_THIS_JOB" ] && ARGS+=" --epochs_this_job $EPOCHS_THIS_JOB" [ -n "$SEED" ] && ARGS+=" --seed $SEED" [ -n "$GRAD_ACCUMULATION" ] && ARGS+=" --grad_accumulation $GRAD_ACCUMULATION" [ "$RESUME" = true ] && ARGS+=" --resume" [ -n "$LOG_FILE" ] && ARGS+=" --log_file $LOG_FILE" [ -n "$BMARK_EPOCHS_NUM" ] && ARGS+=" --benchmark_epochs_num $BMARK_EPOCHS_NUM" : ${DISTRIBUTED:="-m torch.distributed.launch --nproc_per_node $NUM_GPUS"} python $DISTRIBUTED train.py $ARGS "$@"
TensorFlow/LanguageModeling/BERT/scripts
scripts
run_squad_inference
#!/usr/bin/env bash # Copyright (c) 2019 NVIDIA CORPORATION. All rights reserved. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. echo "Container nvidia build = " $NVIDIA_BUILD_ID init_checkpoint=${1:-"data/download/nvidia_pretrained/bert_tf_squad11_large_384/model.ckpt"} batch_size=${2:-"8"} precision=${3:-"fp16"} use_xla=${4:-"true"} seq_length=${5:-"384"} doc_stride=${6:-"128"} bert_model=${7:-"large"} squad_version=${8:-"1.1"} if [ "$bert_model" = "large" ] ; then export BERT_DIR=data/download/nvidia_pretrained/bert_tf_pretraining_large_lamb else export BERT_DIR=data/download/nvidia_pretrained/bert_tf_squad11_base_128 fi export SQUAD_DIR=data/download/squad/v${squad_version} if [ "$squad_version" = "1.1" ] ; then version_2_with_negative="False" else version_2_with_negative="True" fi echo "Squad directory set as " $SQUAD_DIR " BERT directory set as " $BERT_DIR echo "Results directory set as " $RESULTS_DIR use_fp16="" if [ "$precision" = "fp16" ] ; then echo "fp16 activated!" use_fp16="--amp" else echo "fp32/tf32 activated!" use_fp16="--noamp" fi if [ "$use_xla" = "true" ] ; then use_xla_tag="--use_xla" echo "XLA activated" else use_xla_tag="--nouse_xla" fi ckpt_str=${init_checkpoint//\//-} printf -v TAG "tf_bert_finetuning_squad_%s_inf_%s_gbs%d_ckpt_%s" "$bert_model" "$precision" $batch_size "$ckpt_str" DATESTAMP=`date +'%y%m%d%H%M%S'` #Edit to save logs & checkpoints in a different directory RESULTS_DIR=/results LOGFILE=$RESULTS_DIR/$TAG.$DATESTAMP.log printf "Logs written to %s\n" "$LOGFILE" #Check if all necessary files are available before training for DIR_or_file in $SQUAD_DIR $RESULTS_DIR $BERT_DIR/vocab.txt $BERT_DIR/bert_config.json; do if [ ! -d "$DIR_or_file" ] && [ ! -f "$DIR_or_file" ]; then echo "Error! $DIR_or_file directory missing. Please mount correctly" exit -1 fi done python run_squad.py \ --vocab_file=$BERT_DIR/vocab.txt \ --bert_config_file=$BERT_DIR/bert_config.json \ --init_checkpoint=$init_checkpoint \ --do_predict=True \ --predict_file=$SQUAD_DIR/dev-v${squad_version}.json \ --eval_script=$SQUAD_DIR/evaluate-v${squad_version}.py \ --predict_batch_size=$batch_size \ --max_seq_length=$seq_length \ --doc_stride=$doc_stride \ --output_dir=$RESULTS_DIR \ "$use_fp16" \ $use_xla_tag --version_2_with_negative=${version_2_with_negative}
PyTorch/Recommendation/DLRM
DLRM
bind
# Copyright (c) 2021 NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. #! /bin/bash set -euo pipefail print_usage() { cat << EOF ${0} [options] [--] COMMAND [ARG...] Control binding policy for each task. Assumes one rank will be launched for each GPU. Options: --cpu=MODE * exclusive -- bind each rank to an exclusive set of cores near its GPU * exclusive,nosmt -- bind each rank to an exclusive set of cores near its GPU, without hyperthreading * node -- bind each rank to all cores in the NUMA node nearest its GPU [default] * *.sh -- bind each rank using the bash associative array bind_cpu_cores or bind_cpu_nodes from a file * off -- don't bind --mem=MODE * node -- bind each rank to the nearest NUMA node [default] * *.sh -- bind each rank using the bash associative array bind_mem from a file * off -- don't bind --ib=MODE * single -- bind each rank to a single IB device near its GPU * off -- don't bind [default] EOF } ################################################################################ # Argument parsing ################################################################################ cpu_mode='node' mem_mode='node' ib_mode='off' while [ $# -gt 0 ]; do case "$1" in -h|--help) print_usage ; exit 0 ;; --cpu=*) cpu_mode="${1/*=/}"; shift ;; --cpu) cpu_mode="$2"; shift 2 ;; --mem=*) mem_mode="${1/*=/}"; shift ;; --mem) mem_mode="$2"; shift 2 ;; --ib=*) ib_mode="${1/*=/}"; shift ;; --ib) ib_mode="$2"; shift 2 ;; --) shift; break ;; *) break ;; esac done if [ $# -lt 1 ]; then echo 'ERROR: no command given' 2>&1 print_usage exit 1 fi ################################################################################ # Get system params ################################################################################ # LOCAL_RANK is set with an enroot hook for Pytorch containers # SLURM_LOCALID is set by Slurm # OMPI_COMM_WORLD_LOCAL_RANK is set by mpirun readonly local_rank="${LOCAL_RANK:=${SLURM_LOCALID:=${OMPI_COMM_WORLD_LOCAL_RANK:-}}}" if [ -z "${local_rank}" ]; then echo 'ERROR: cannot read LOCAL_RANK from env' >&2 exit 1 fi num_gpus=$(nvidia-smi -i 0 --query-gpu=count --format=csv,noheader,nounits) if [ "${local_rank}" -ge "${num_gpus}" ]; then echo "ERROR: local rank is ${local_rank}, but there are only ${num_gpus} gpus available" >&2 exit 1 fi get_lscpu_value() { awk -F: "(\$1 == \"${1}\"){gsub(/ /, \"\", \$2); print \$2; found=1} END{exit found!=1}" } lscpu_out=$(lscpu) num_sockets=$(get_lscpu_value 'Socket(s)' <<< "${lscpu_out}") num_nodes=$(get_lscpu_value 'NUMA node(s)' <<< "${lscpu_out}") cores_per_socket=$(get_lscpu_value 'Core(s) per socket' <<< "${lscpu_out}") echo "num_sockets = ${num_sockets} num_nodes=${num_nodes} cores_per_socket=${cores_per_socket}" readonly cores_per_node=$(( (num_sockets * cores_per_socket) / num_nodes )) if [ ${num_gpus} -gt 1 ]; then readonly gpus_per_node=$(( num_gpus / num_nodes )) else readonly gpus_per_node=1 fi readonly cores_per_gpu=$(( cores_per_node / gpus_per_node )) readonly local_node=$(( local_rank / gpus_per_node )) declare -a ibdevs=() readonly num_ibdevs="${#ibdevs[@]}" ################################################################################ # Setup for exec ################################################################################ declare -a numactl_args=() case "${cpu_mode}" in exclusive) numactl_args+=( "$(printf -- "--physcpubind=%u-%u,%u-%u" \ $(( local_rank * cores_per_gpu )) \ $(( (local_rank + 1) * cores_per_gpu - 1 )) \ $(( local_rank * cores_per_gpu + (cores_per_gpu * gpus_per_node * num_nodes) )) \ $(( (local_rank + 1) * cores_per_gpu + (cores_per_gpu * gpus_per_node * num_nodes) - 1 )) \ )" ) ;; exclusive,nosmt) numactl_args+=( "$(printf -- "--physcpubind=%u-%u" \ $(( local_rank * cores_per_gpu )) \ $(( (local_rank + 1) * cores_per_gpu - 1 )) \ )" ) ;; node) numactl_args+=( "--cpunodebind=${local_node}" ) ;; *.sh) source "${cpu_mode}" if [ -n "${bind_cpu_cores:-}" ]; then numactl_args+=( "--physcpubind=${bind_cpu_cores[${local_rank}]}" ) elif [ -n "${bind_cpu_nodes:-}" ]; then numactl_args+=( "--cpunodebind=${bind_cpu_nodes[${local_rank}]}" ) else echo "ERROR: invalid CPU affinity file ${cpu_mode}." >&2 exit 1 fi ;; off|'') ;; *) echo "ERROR: invalid cpu mode '${cpu_mode}'" 2>&1 print_usage exit 1 ;; esac case "${mem_mode}" in node) numactl_args+=( "--membind=${local_node}" ) ;; *.sh) source "${mem_mode}" if [ -z "${bind_mem:-}" ]; then echo "ERROR: invalid memory affinity file ${mem_mode}." >&2 exit 1 fi numactl_args+=( "--membind=${bind_mem[${local_rank}]}" ) ;; off|'') ;; *) echo "ERROR: invalid mem mode '${mem_mode}'" 2>&1 print_usage exit 1 ;; esac case "${ib_mode}" in single) if [ "${num_ibdevs}" -eq 0 ]; then echo "WARNING: used '$0 --ib=single', but there are 0 IB devices available; skipping IB binding." 2>&1 else readonly ibdev="${ibdevs[$(( local_rank * num_ibdevs / num_gpus ))]}" export OMPI_MCA_btl_openib_if_include="${OMPI_MCA_btl_openib_if_include-$ibdev}" export UCX_NET_DEVICES="${UCX_NET_DEVICES-$ibdev:1}" fi ;; off|'') ;; *) echo "ERROR: invalid ib mode '${ib_mode}'" 2>&1 print_usage exit 1 ;; esac ################################################################################ # Exec ################################################################################ if [ "${#numactl_args[@]}" -gt 0 ] ; then exec numactl "${numactl_args[@]}" -- "${@}" else exec "${@}" fi
TensorFlow2/Segmentation/MaskRCNN/mrcnn_tf2/runtime
runtime
learning_rate
import tensorflow as tf class PiecewiseConstantWithWarmupSchedule(tf.keras.optimizers.schedules.LearningRateSchedule): """ Schedule that starts with learning rate at `init_value` and monotonically increases it up to `values[0]` at step `boundaries[0]`. After that the learning rate changes on each boundary to corresponding value. """ def __init__(self, init_value, boundaries, values, scale=1.0, name='PiecewiseConstantWithWarmup'): """ Constructs piecewise constant learning rate with linear warmup. Args: init_value (float): Learning rate at step 0. boundaries (List[int]): Steps at which the learning rate will change. values (List[float]): Values to which the learning rate will be changed. scale (float): Scales the computed lr by given constant. name (str): Name of the operation. """ assert len(values) > 0 assert len(values) == len(boundaries) self._init_value = float(init_value) self._values = list(map(float, values)) self._boundaries = list(map(float, boundaries)) self._scale = float(scale) self._name = name def __call__(self, step): with tf.name_scope(self._name): # linear learning rate before first boundary warmup_lr = self._init_value + (self._values[0] - self._init_value) * (step / self._boundaries[0]) warmup_pred = (tf.less(step, self._boundaries[0]), lambda: warmup_lr) # step learning rate after first boundary boundaries_pred = [ (tf.less(step, limit), lambda v=v: v) for limit, v in zip(self._boundaries[1:], self._values) ] learning_rate = tf.case( pred_fn_pairs=[warmup_pred] + boundaries_pred, default=lambda: self._values[-1] ) return learning_rate * self._scale def get_config(self): return { "init_value": self._init_value, "values": self._values, "boundaries": self._boundaries, "name": self._name }
TensorFlow2/LanguageModeling/BERT/official/utils/logs
logs
hooks_helper_test
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== """Tests for hooks_helper.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import unittest import tensorflow as tf # pylint: disable=g-bad-import-order from official.utils.logs import hooks_helper from official.utils.misc import keras_utils class BaseTest(unittest.TestCase): def setUp(self): super(BaseTest, self).setUp() if keras_utils.is_v2_0: tf.compat.v1.disable_eager_execution() def test_raise_in_non_list_names(self): with self.assertRaises(ValueError): hooks_helper.get_train_hooks( 'LoggingTensorHook, ProfilerHook', model_dir="", batch_size=256) def test_raise_in_invalid_names(self): invalid_names = ['StepCounterHook', 'StopAtStepHook'] with self.assertRaises(ValueError): hooks_helper.get_train_hooks(invalid_names, model_dir="", batch_size=256) def validate_train_hook_name(self, test_hook_name, expected_hook_name, **kwargs): returned_hook = hooks_helper.get_train_hooks( [test_hook_name], model_dir="", **kwargs) self.assertEqual(len(returned_hook), 1) self.assertIsInstance(returned_hook[0], tf.estimator.SessionRunHook) self.assertEqual(returned_hook[0].__class__.__name__.lower(), expected_hook_name) def test_get_train_hooks_logging_tensor_hook(self): self.validate_train_hook_name('LoggingTensorHook', 'loggingtensorhook') def test_get_train_hooks_profiler_hook(self): self.validate_train_hook_name('ProfilerHook', 'profilerhook') def test_get_train_hooks_examples_per_second_hook(self): self.validate_train_hook_name('ExamplesPerSecondHook', 'examplespersecondhook') def test_get_logging_metric_hook(self): test_hook_name = 'LoggingMetricHook' self.validate_train_hook_name(test_hook_name, 'loggingmetrichook') if __name__ == '__main__': tf.test.main()
TensorFlow/Detection/SSD/models/research/object_detection/dataset_tools
dataset_tools
download_and_preprocess_mscoco
#!/bin/bash # Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== # Script to download and preprocess the MSCOCO data set for detection. # # The outputs of this script are TFRecord files containing serialized # tf.Example protocol buffers. See create_coco_tf_record.py for details of how # the tf.Example protocol buffers are constructed and see # http://cocodataset.org/#overview for an overview of the dataset. # # usage: # bash object_detection/dataset_tools/download_and_preprocess_mscoco.sh \ # /tmp/mscoco set -e if [ -z "$1" ]; then echo "usage download_and_preprocess_mscoco.sh [data dir]" exit fi if [ "$(uname)" == "Darwin" ]; then UNZIP="tar -xf" else UNZIP="unzip -nq" fi # Create the output directories. OUTPUT_DIR="${1%/}" SCRATCH_DIR="${OUTPUT_DIR}/raw-data" mkdir -p "${OUTPUT_DIR}" mkdir -p "${SCRATCH_DIR}" CURRENT_DIR=$(pwd) # Helper function to download and unpack a .zip file. function download_and_unzip() { local BASE_URL=${1} local FILENAME=${2} if [ ! -f ${FILENAME} ]; then echo "Downloading ${FILENAME} to $(pwd)" wget -nd -c "${BASE_URL}/${FILENAME}" else echo "Skipping download of ${FILENAME}" fi echo "Unzipping ${FILENAME}" ${UNZIP} ${FILENAME} } cd ${SCRATCH_DIR} # Download the images. BASE_IMAGE_URL="http://images.cocodataset.org/zips" TRAIN_IMAGE_FILE="train2017.zip" download_and_unzip ${BASE_IMAGE_URL} ${TRAIN_IMAGE_FILE} TRAIN_IMAGE_DIR="${SCRATCH_DIR}/train2017" VAL_IMAGE_FILE="val2017.zip" download_and_unzip ${BASE_IMAGE_URL} ${VAL_IMAGE_FILE} VAL_IMAGE_DIR="${SCRATCH_DIR}/val2017" TEST_IMAGE_FILE="test2017.zip" download_and_unzip ${BASE_IMAGE_URL} ${TEST_IMAGE_FILE} TEST_IMAGE_DIR="${SCRATCH_DIR}/test2017" # Download the annotations. BASE_INSTANCES_URL="http://images.cocodataset.org/annotations" INSTANCES_FILE="annotations_trainval2017.zip" download_and_unzip ${BASE_INSTANCES_URL} ${INSTANCES_FILE} TRAIN_ANNOTATIONS_FILE="${SCRATCH_DIR}/annotations/instances_train2017.json" VAL_ANNOTATIONS_FILE="${SCRATCH_DIR}/annotations/instances_val2017.json" # Download the test image info. BASE_IMAGE_INFO_URL="http://images.cocodataset.org/annotations" IMAGE_INFO_FILE="image_info_test2017.zip" download_and_unzip ${BASE_IMAGE_INFO_URL} ${IMAGE_INFO_FILE} TESTDEV_ANNOTATIONS_FILE="${SCRATCH_DIR}/annotations/image_info_test-dev2017.json" # Build TFRecords of the image data. cd "${CURRENT_DIR}" python object_detection/dataset_tools/create_coco_tf_record.py \ --logtostderr \ --include_masks \ --train_image_dir="${TRAIN_IMAGE_DIR}" \ --val_image_dir="${VAL_IMAGE_DIR}" \ --test_image_dir="${TEST_IMAGE_DIR}" \ --train_annotations_file="${TRAIN_ANNOTATIONS_FILE}" \ --val_annotations_file="${VAL_ANNOTATIONS_FILE}" \ --testdev_annotations_file="${TESTDEV_ANNOTATIONS_FILE}" \ --output_dir="${OUTPUT_DIR}"
TensorFlow/Detection/SSD/models/research/object_detection/models
models
ssd_inception_v2_feature_extractor_test
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== """Tests for object_detection.models.ssd_inception_v2_feature_extractor.""" import numpy as np import tensorflow as tf from object_detection.models import ssd_feature_extractor_test from object_detection.models import ssd_inception_v2_feature_extractor class SsdInceptionV2FeatureExtractorTest( ssd_feature_extractor_test.SsdFeatureExtractorTestBase): def _create_feature_extractor(self, depth_multiplier, pad_to_multiple, is_training=True): """Constructs a SsdInceptionV2FeatureExtractor. Args: depth_multiplier: float depth multiplier for feature extractor pad_to_multiple: the nearest multiple to zero pad the input height and width dimensions to. is_training: whether the network is in training mode. Returns: an ssd_inception_v2_feature_extractor.SsdInceptionV2FeatureExtractor. """ min_depth = 32 return ssd_inception_v2_feature_extractor.SSDInceptionV2FeatureExtractor( is_training, depth_multiplier, min_depth, pad_to_multiple, self.conv_hyperparams_fn, override_base_feature_extractor_hyperparams=True) def test_extract_features_returns_correct_shapes_128(self): image_height = 128 image_width = 128 depth_multiplier = 1.0 pad_to_multiple = 1 expected_feature_map_shape = [(2, 8, 8, 576), (2, 4, 4, 1024), (2, 2, 2, 512), (2, 1, 1, 256), (2, 1, 1, 256), (2, 1, 1, 128)] self.check_extract_features_returns_correct_shape( 2, image_height, image_width, depth_multiplier, pad_to_multiple, expected_feature_map_shape) def test_extract_features_returns_correct_shapes_with_dynamic_inputs(self): image_height = 128 image_width = 128 depth_multiplier = 1.0 pad_to_multiple = 1 expected_feature_map_shape = [(2, 8, 8, 576), (2, 4, 4, 1024), (2, 2, 2, 512), (2, 1, 1, 256), (2, 1, 1, 256), (2, 1, 1, 128)] self.check_extract_features_returns_correct_shapes_with_dynamic_inputs( 2, image_height, image_width, depth_multiplier, pad_to_multiple, expected_feature_map_shape) def test_extract_features_returns_correct_shapes_299(self): image_height = 299 image_width = 299 depth_multiplier = 1.0 pad_to_multiple = 1 expected_feature_map_shape = [(2, 19, 19, 576), (2, 10, 10, 1024), (2, 5, 5, 512), (2, 3, 3, 256), (2, 2, 2, 256), (2, 1, 1, 128)] self.check_extract_features_returns_correct_shape( 2, image_height, image_width, depth_multiplier, pad_to_multiple, expected_feature_map_shape) def test_extract_features_returns_correct_shapes_enforcing_min_depth(self): image_height = 299 image_width = 299 depth_multiplier = 0.5**12 pad_to_multiple = 1 expected_feature_map_shape = [(2, 19, 19, 128), (2, 10, 10, 128), (2, 5, 5, 32), (2, 3, 3, 32), (2, 2, 2, 32), (2, 1, 1, 32)] self.check_extract_features_returns_correct_shape( 2, image_height, image_width, depth_multiplier, pad_to_multiple, expected_feature_map_shape) def test_extract_features_returns_correct_shapes_with_pad_to_multiple(self): image_height = 299 image_width = 299 depth_multiplier = 1.0 pad_to_multiple = 32 expected_feature_map_shape = [(2, 20, 20, 576), (2, 10, 10, 1024), (2, 5, 5, 512), (2, 3, 3, 256), (2, 2, 2, 256), (2, 1, 1, 128)] self.check_extract_features_returns_correct_shape( 2, image_height, image_width, depth_multiplier, pad_to_multiple, expected_feature_map_shape) def test_extract_features_raises_error_with_invalid_image_size(self): image_height = 32 image_width = 32 depth_multiplier = 1.0 pad_to_multiple = 1 self.check_extract_features_raises_error_with_invalid_image_size( image_height, image_width, depth_multiplier, pad_to_multiple) def test_preprocess_returns_correct_value_range(self): image_height = 128 image_width = 128 depth_multiplier = 1 pad_to_multiple = 1 test_image = np.random.rand(4, image_height, image_width, 3) feature_extractor = self._create_feature_extractor(depth_multiplier, pad_to_multiple) preprocessed_image = feature_extractor.preprocess(test_image) self.assertTrue(np.all(np.less_equal(np.abs(preprocessed_image), 1.0))) def test_variables_only_created_in_scope(self): depth_multiplier = 1 pad_to_multiple = 1 scope_name = 'InceptionV2' self.check_feature_extractor_variables_under_scope( depth_multiplier, pad_to_multiple, scope_name) if __name__ == '__main__': tf.test.main()
TensorFlow2/Recommendation/SIM/preprocessing
preprocessing
io
# Copyright (c) 2022 NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import ast import json import multiprocessing from typing import Dict import cudf import dask.dataframe JSON_READ_BLOCKSIZE = 100_000_000 def _read_metadata_line(line: str) -> Dict[str, str]: dict_line = ast.literal_eval(line) return {"item": dict_line["asin"], "cat": dict_line["categories"][0][-1]} def load_metadata( path: str, n_proc: int, ) -> cudf.DataFrame: metadata = [] with open(path) as fp: metadata = fp.readlines() with multiprocessing.Pool(n_proc) as pool: metadata = pool.map(_read_metadata_line, metadata) df = cudf.DataFrame(metadata) return df def _read_json(*args, **kwargs): df = cudf.read_json(*args, **kwargs) df = df.rename(columns={"reviewerID": "user", "asin": "item"}) df = df[["user", "item", "unixReviewTime"]] return df def load_review_data( path: str, num_workers: int, dask_scheduler="processes", ) -> cudf.DataFrame: ddf = dask.dataframe.read_json( path, lines=True, blocksize=JSON_READ_BLOCKSIZE, engine=_read_json, ) df = ddf.compute(scheduler=dask_scheduler, num_workers=num_workers) return df def save_metadata( number_of_items: int, number_of_categories: int, number_of_users: int, output_path: str, ): data = { "cardinalities": [ {"name": "uid", "value": number_of_users}, {"name": "item", "value": number_of_items}, {"name": "cat", "value": number_of_categories}, ], } with open(output_path, "w") as fp: json.dump(data, fp)
PyTorch/SpeechRecognition/Jasper/triton/model_repo_configs/fp32/jasper-tensorrt-ensemble
jasper-tensorrt-ensemble
config
name: "jasper-tensorrt-ensemble" platform: "ensemble" max_batch_size: 8#MAX_BATCH input { name: "AUDIO_SIGNAL" data_type: TYPE_FP32 dims: -1#AUDIO_LENGTH } input { name: "NUM_SAMPLES" data_type: TYPE_INT32 dims: [ 1 ] } output { name: "TRANSCRIPT" data_type: TYPE_INT32 dims: [-1] } ensemble_scheduling { step { model_name: "feature-extractor-ts-trace" model_version: -1 input_map { key: "input__0" value: "AUDIO_SIGNAL" } input_map { key: "input__1" value: "NUM_SAMPLES" } output_map { key: "output__0" value: "AUDIO_FEATURES" } } step { model_name: "jasper-tensorrt" model_version: -1 input_map { key: "input__0" value: "AUDIO_FEATURES" } output_map { key: "output__0" value: "CHARACTER_PROBABILITIES" } } step { model_name: "decoder-ts-script" model_version: -1 input_map { key: "input__0" value: "CHARACTER_PROBABILITIES" } output_map { key: "output__0" value: "TRANSCRIPT" } } }
PyTorch/Segmentation/MaskRCNN/pytorch/configs/caffe2
caffe2
e2e_mask_rcnn_R_50_C4_1x_caffe2
MODEL: META_ARCHITECTURE: "GeneralizedRCNN" WEIGHT: "catalog://Caffe2Detectron/COCO/35858791/e2e_mask_rcnn_R-50-C4_1x" ROI_MASK_HEAD: PREDICTOR: "MaskRCNNC4Predictor" SHARE_BOX_FEATURE_EXTRACTOR: True MASK_ON: True DATASETS: TEST: ("coco_2014_minival",)
TensorFlow/Segmentation/UNet_Medical/model
model
layers
# Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # -*- coding: utf-8 -*- """ Contains a set of utilities that allow building the UNet model """ import tensorflow as tf def _crop_and_concat(inputs, residual_input): """ Perform a central crop of ``residual_input`` and concatenate to ``inputs`` Args: inputs (tf.Tensor): Tensor with input residual_input (tf.Tensor): Residual input Return: Concatenated tf.Tensor with the size of ``inputs`` """ factor = inputs.shape[1].value / residual_input.shape[1].value return tf.concat([inputs, tf.image.central_crop(residual_input, factor)], axis=-1) def downsample_block(inputs, filters, idx): """ UNet downsample block Perform 2 unpadded convolutions with a specified number of filters and downsample through max-pooling Args: inputs (tf.Tensor): Tensor with inputs filters (int): Number of filters in convolution Return: Tuple of convolved ``inputs`` after and before downsampling """ out = inputs with tf.name_scope('downsample_block_{}'.format(idx)): out = tf.layers.conv2d(inputs=out, filters=filters, kernel_size=(3, 3), activation=tf.nn.relu) out = tf.layers.conv2d(inputs=out, filters=filters, kernel_size=(3, 3), activation=tf.nn.relu) return tf.layers.max_pooling2d(inputs=out, pool_size=(2, 2), strides=2), out def upsample_block(inputs, residual_input, filters, idx): """ UNet upsample block Perform 2 unpadded convolutions with a specified number of filters and upsample Args: inputs (tf.Tensor): Tensor with inputs residual_input (tf.Tensor): Residual input filters (int): Number of filters in convolution Return: Convolved ``inputs`` after upsampling """ out = _crop_and_concat(inputs, residual_input) with tf.name_scope('upsample_block_{}'.format(idx)): out = tf.layers.conv2d(inputs=out, filters=filters, kernel_size=(3, 3), activation=tf.nn.relu) out = tf.layers.conv2d(inputs=out, filters=int(filters), kernel_size=(3, 3), activation=tf.nn.relu) return tf.layers.conv2d_transpose(inputs=out, filters=int(filters // 2), kernel_size=(3, 3), strides=(2, 2), padding='same', activation=tf.nn.relu) def bottleneck(inputs, filters, mode): """ UNet central block Perform 2 unpadded convolutions with a specified number of filters and upsample including dropout before upsampling for training Args: inputs (tf.Tensor): Tensor with inputs filters (int): Number of filters in convolution Return: Convolved ``inputs`` after upsampling """ out = inputs with tf.name_scope('bottleneck'): out = tf.layers.conv2d(inputs=out, filters=filters, kernel_size=(3, 3), activation=tf.nn.relu) out = tf.layers.conv2d(inputs=out, filters=filters, kernel_size=(3, 3), activation=tf.nn.relu) training = (mode == tf.estimator.ModeKeys.TRAIN) out = tf.layers.dropout(out, rate=0.5, training=training) return tf.layers.conv2d_transpose(inputs=out, filters=filters // 2, kernel_size=(3, 3), strides=(2, 2), padding='same', activation=tf.nn.relu) def output_block(inputs, residual_input, filters, n_classes): """ UNet output Perform 3 unpadded convolutions, the last one with the same number of channels as classes we want to classify Args: inputs (tf.Tensor): Tensor with inputs residual_input (tf.Tensor): Residual input filters (int): Number of filters in convolution n_classes (int): Number of output classes Return: Convolved ``inputs`` with as many channels as classes """ out = _crop_and_concat(inputs, residual_input) with tf.name_scope('output'): out = tf.layers.conv2d(inputs=out, filters=filters, kernel_size=(3, 3), activation=tf.nn.relu) out = tf.layers.conv2d(inputs=out, filters=filters, kernel_size=(3, 3), activation=tf.nn.relu) return tf.layers.conv2d(inputs=out, filters=n_classes, kernel_size=(1, 1), activation=None) def input_block(inputs, filters): """ UNet input block Perform 2 unpadded convolutions with a specified number of filters and downsample through max-pooling. First convolution Args: inputs (tf.Tensor): Tensor with inputs filters (int): Number of filters in convolution Return: Tuple of convolved ``inputs`` after and before downsampling """ out = inputs with tf.name_scope('input'): out = tf.layers.conv2d(inputs=out, filters=filters, kernel_size=(3, 3), activation=tf.nn.relu) out = tf.layers.conv2d(inputs=out, filters=filters, kernel_size=(3, 3), activation=tf.nn.relu) return tf.layers.max_pooling2d(inputs=out, pool_size=(2, 2), strides=2), out
PyTorch/Recommendation/DLRM/tests/feature_specs
feature_specs
13_num_10_cat
channel_spec: categorical: - cat_0.bin - cat_1.bin - cat_2.bin - cat_3.bin - cat_4.bin - cat_5.bin - cat_6.bin - cat_7.bin - cat_8.bin - cat_9.bin label: - label numerical: &id001 - num_0 - num_1 - num_2 - num_3 - num_4 - num_5 - num_6 - num_7 - num_8 - num_9 - num_10 - num_11 - num_12 feature_spec: cat_0.bin: cardinality: 100000 dtype: int32 cat_1.bin: cardinality: 100001 dtype: int32 cat_2.bin: cardinality: 100002 dtype: int32 cat_3.bin: cardinality: 100003 dtype: int32 cat_4.bin: cardinality: 100004 dtype: int32 cat_5.bin: cardinality: 100005 dtype: int32 cat_6.bin: cardinality: 100006 dtype: int32 cat_7.bin: cardinality: 100007 dtype: int32 cat_8.bin: cardinality: 100008 dtype: int32 cat_9.bin: cardinality: 10009 dtype: int16 label: dtype: bool num_0: dtype: float16 num_1: dtype: float16 num_10: dtype: float16 num_11: dtype: float16 num_12: dtype: float16 num_2: dtype: float16 num_3: dtype: float16 num_4: dtype: float16 num_5: dtype: float16 num_6: dtype: float16 num_7: dtype: float16 num_8: dtype: float16 num_9: dtype: float16 metadata: {} source_spec: test: - features: *id001 files: - test/numerical.bin type: split_binary - features: - label files: - test/label.bin type: split_binary - features: - cat_0.bin files: - test/cat_0.bin type: split_binary - features: - cat_1.bin files: - test/cat_1.bin type: split_binary - features: - cat_2.bin files: - test/cat_2.bin type: split_binary - features: - cat_3.bin files: - test/cat_3.bin type: split_binary - features: - cat_4.bin files: - test/cat_4.bin type: split_binary - features: - cat_5.bin files: - test/cat_5.bin type: split_binary - features: - cat_6.bin files: - test/cat_6.bin type: split_binary - features: - cat_7.bin files: - test/cat_7.bin type: split_binary - features: - cat_8.bin files: - test/cat_8.bin type: split_binary - features: - cat_9.bin files: - test/cat_9.bin type: split_binary train: - features: *id001 files: - train/numerical.bin type: split_binary - features: - label files: - train/label.bin type: split_binary - features: - cat_0.bin files: - train/cat_0.bin type: split_binary - features: - cat_1.bin files: - train/cat_1.bin type: split_binary - features: - cat_2.bin files: - train/cat_2.bin type: split_binary - features: - cat_3.bin files: - train/cat_3.bin type: split_binary - features: - cat_4.bin files: - train/cat_4.bin type: split_binary - features: - cat_5.bin files: - train/cat_5.bin type: split_binary - features: - cat_6.bin files: - train/cat_6.bin type: split_binary - features: - cat_7.bin files: - train/cat_7.bin type: split_binary - features: - cat_8.bin files: - train/cat_8.bin type: split_binary - features: - cat_9.bin files: - train/cat_9.bin type: split_binary
TensorFlow/Detection/SSD/models/research/slim/nets
nets
mobilenet_v1
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================= """MobileNet v1. MobileNet is a general architecture and can be used for multiple use cases. Depending on the use case, it can use different input layer size and different head (for example: embeddings, localization and classification). As described in https://arxiv.org/abs/1704.04861. MobileNets: Efficient Convolutional Neural Networks for Mobile Vision Applications Andrew G. Howard, Menglong Zhu, Bo Chen, Dmitry Kalenichenko, Weijun Wang, Tobias Weyand, Marco Andreetto, Hartwig Adam 100% Mobilenet V1 (base) with input size 224x224: See mobilenet_v1() Layer params macs -------------------------------------------------------------------------------- MobilenetV1/Conv2d_0/Conv2D: 864 10,838,016 MobilenetV1/Conv2d_1_depthwise/depthwise: 288 3,612,672 MobilenetV1/Conv2d_1_pointwise/Conv2D: 2,048 25,690,112 MobilenetV1/Conv2d_2_depthwise/depthwise: 576 1,806,336 MobilenetV1/Conv2d_2_pointwise/Conv2D: 8,192 25,690,112 MobilenetV1/Conv2d_3_depthwise/depthwise: 1,152 3,612,672 MobilenetV1/Conv2d_3_pointwise/Conv2D: 16,384 51,380,224 MobilenetV1/Conv2d_4_depthwise/depthwise: 1,152 903,168 MobilenetV1/Conv2d_4_pointwise/Conv2D: 32,768 25,690,112 MobilenetV1/Conv2d_5_depthwise/depthwise: 2,304 1,806,336 MobilenetV1/Conv2d_5_pointwise/Conv2D: 65,536 51,380,224 MobilenetV1/Conv2d_6_depthwise/depthwise: 2,304 451,584 MobilenetV1/Conv2d_6_pointwise/Conv2D: 131,072 25,690,112 MobilenetV1/Conv2d_7_depthwise/depthwise: 4,608 903,168 MobilenetV1/Conv2d_7_pointwise/Conv2D: 262,144 51,380,224 MobilenetV1/Conv2d_8_depthwise/depthwise: 4,608 903,168 MobilenetV1/Conv2d_8_pointwise/Conv2D: 262,144 51,380,224 MobilenetV1/Conv2d_9_depthwise/depthwise: 4,608 903,168 MobilenetV1/Conv2d_9_pointwise/Conv2D: 262,144 51,380,224 MobilenetV1/Conv2d_10_depthwise/depthwise: 4,608 903,168 MobilenetV1/Conv2d_10_pointwise/Conv2D: 262,144 51,380,224 MobilenetV1/Conv2d_11_depthwise/depthwise: 4,608 903,168 MobilenetV1/Conv2d_11_pointwise/Conv2D: 262,144 51,380,224 MobilenetV1/Conv2d_12_depthwise/depthwise: 4,608 225,792 MobilenetV1/Conv2d_12_pointwise/Conv2D: 524,288 25,690,112 MobilenetV1/Conv2d_13_depthwise/depthwise: 9,216 451,584 MobilenetV1/Conv2d_13_pointwise/Conv2D: 1,048,576 51,380,224 -------------------------------------------------------------------------------- Total: 3,185,088 567,716,352 75% Mobilenet V1 (base) with input size 128x128: See mobilenet_v1_075() Layer params macs -------------------------------------------------------------------------------- MobilenetV1/Conv2d_0/Conv2D: 648 2,654,208 MobilenetV1/Conv2d_1_depthwise/depthwise: 216 884,736 MobilenetV1/Conv2d_1_pointwise/Conv2D: 1,152 4,718,592 MobilenetV1/Conv2d_2_depthwise/depthwise: 432 442,368 MobilenetV1/Conv2d_2_pointwise/Conv2D: 4,608 4,718,592 MobilenetV1/Conv2d_3_depthwise/depthwise: 864 884,736 MobilenetV1/Conv2d_3_pointwise/Conv2D: 9,216 9,437,184 MobilenetV1/Conv2d_4_depthwise/depthwise: 864 221,184 MobilenetV1/Conv2d_4_pointwise/Conv2D: 18,432 4,718,592 MobilenetV1/Conv2d_5_depthwise/depthwise: 1,728 442,368 MobilenetV1/Conv2d_5_pointwise/Conv2D: 36,864 9,437,184 MobilenetV1/Conv2d_6_depthwise/depthwise: 1,728 110,592 MobilenetV1/Conv2d_6_pointwise/Conv2D: 73,728 4,718,592 MobilenetV1/Conv2d_7_depthwise/depthwise: 3,456 221,184 MobilenetV1/Conv2d_7_pointwise/Conv2D: 147,456 9,437,184 MobilenetV1/Conv2d_8_depthwise/depthwise: 3,456 221,184 MobilenetV1/Conv2d_8_pointwise/Conv2D: 147,456 9,437,184 MobilenetV1/Conv2d_9_depthwise/depthwise: 3,456 221,184 MobilenetV1/Conv2d_9_pointwise/Conv2D: 147,456 9,437,184 MobilenetV1/Conv2d_10_depthwise/depthwise: 3,456 221,184 MobilenetV1/Conv2d_10_pointwise/Conv2D: 147,456 9,437,184 MobilenetV1/Conv2d_11_depthwise/depthwise: 3,456 221,184 MobilenetV1/Conv2d_11_pointwise/Conv2D: 147,456 9,437,184 MobilenetV1/Conv2d_12_depthwise/depthwise: 3,456 55,296 MobilenetV1/Conv2d_12_pointwise/Conv2D: 294,912 4,718,592 MobilenetV1/Conv2d_13_depthwise/depthwise: 6,912 110,592 MobilenetV1/Conv2d_13_pointwise/Conv2D: 589,824 9,437,184 -------------------------------------------------------------------------------- Total: 1,800,144 106,002,432 """ # Tensorflow mandates these. from __future__ import absolute_import from __future__ import division from __future__ import print_function from collections import namedtuple import functools import tensorflow as tf slim = tf.contrib.slim # Conv and DepthSepConv namedtuple define layers of the MobileNet architecture # Conv defines 3x3 convolution layers # DepthSepConv defines 3x3 depthwise convolution followed by 1x1 convolution. # stride is the stride of the convolution # depth is the number of channels or filters in a layer Conv = namedtuple('Conv', ['kernel', 'stride', 'depth']) DepthSepConv = namedtuple('DepthSepConv', ['kernel', 'stride', 'depth']) # MOBILENETV1_CONV_DEFS specifies the MobileNet body MOBILENETV1_CONV_DEFS = [ Conv(kernel=[3, 3], stride=2, depth=32), DepthSepConv(kernel=[3, 3], stride=1, depth=64), DepthSepConv(kernel=[3, 3], stride=2, depth=128), DepthSepConv(kernel=[3, 3], stride=1, depth=128), DepthSepConv(kernel=[3, 3], stride=2, depth=256), DepthSepConv(kernel=[3, 3], stride=1, depth=256), DepthSepConv(kernel=[3, 3], stride=2, depth=512), DepthSepConv(kernel=[3, 3], stride=1, depth=512), DepthSepConv(kernel=[3, 3], stride=1, depth=512), DepthSepConv(kernel=[3, 3], stride=1, depth=512), DepthSepConv(kernel=[3, 3], stride=1, depth=512), DepthSepConv(kernel=[3, 3], stride=1, depth=512), DepthSepConv(kernel=[3, 3], stride=2, depth=1024), DepthSepConv(kernel=[3, 3], stride=1, depth=1024) ] def _fixed_padding(inputs, kernel_size, rate=1): """Pads the input along the spatial dimensions independently of input size. Pads the input such that if it was used in a convolution with 'VALID' padding, the output would have the same dimensions as if the unpadded input was used in a convolution with 'SAME' padding. Args: inputs: A tensor of size [batch, height_in, width_in, channels]. kernel_size: The kernel to be used in the conv2d or max_pool2d operation. rate: An integer, rate for atrous convolution. Returns: output: A tensor of size [batch, height_out, width_out, channels] with the input, either intact (if kernel_size == 1) or padded (if kernel_size > 1). """ kernel_size_effective = [kernel_size[0] + (kernel_size[0] - 1) * (rate - 1), kernel_size[0] + (kernel_size[0] - 1) * (rate - 1)] pad_total = [kernel_size_effective[0] - 1, kernel_size_effective[1] - 1] pad_beg = [pad_total[0] // 2, pad_total[1] // 2] pad_end = [pad_total[0] - pad_beg[0], pad_total[1] - pad_beg[1]] padded_inputs = tf.pad(inputs, [[0, 0], [pad_beg[0], pad_end[0]], [pad_beg[1], pad_end[1]], [0, 0]]) return padded_inputs def mobilenet_v1_base(inputs, final_endpoint='Conv2d_13_pointwise', min_depth=8, depth_multiplier=1.0, conv_defs=None, output_stride=None, use_explicit_padding=False, scope=None): """Mobilenet v1. Constructs a Mobilenet v1 network from inputs to the given final endpoint. Args: inputs: a tensor of shape [batch_size, height, width, channels]. final_endpoint: specifies the endpoint to construct the network up to. It can be one of ['Conv2d_0', 'Conv2d_1_pointwise', 'Conv2d_2_pointwise', 'Conv2d_3_pointwise', 'Conv2d_4_pointwise', 'Conv2d_5'_pointwise, 'Conv2d_6_pointwise', 'Conv2d_7_pointwise', 'Conv2d_8_pointwise', 'Conv2d_9_pointwise', 'Conv2d_10_pointwise', 'Conv2d_11_pointwise', 'Conv2d_12_pointwise', 'Conv2d_13_pointwise']. min_depth: Minimum depth value (number of channels) for all convolution ops. Enforced when depth_multiplier < 1, and not an active constraint when depth_multiplier >= 1. depth_multiplier: Float multiplier for the depth (number of channels) for all convolution ops. The value must be greater than zero. Typical usage will be to set this value in (0, 1) to reduce the number of parameters or computation cost of the model. conv_defs: A list of ConvDef namedtuples specifying the net architecture. output_stride: An integer that specifies the requested ratio of input to output spatial resolution. If not None, then we invoke atrous convolution if necessary to prevent the network from reducing the spatial resolution of the activation maps. Allowed values are 8 (accurate fully convolutional mode), 16 (fast fully convolutional mode), 32 (classification mode). use_explicit_padding: Use 'VALID' padding for convolutions, but prepad inputs so that the output dimensions are the same as if 'SAME' padding were used. scope: Optional variable_scope. Returns: tensor_out: output tensor corresponding to the final_endpoint. end_points: a set of activations for external use, for example summaries or losses. Raises: ValueError: if final_endpoint is not set to one of the predefined values, or depth_multiplier <= 0, or the target output_stride is not allowed. """ depth = lambda d: max(int(d * depth_multiplier), min_depth) end_points = {} # Used to find thinned depths for each layer. if depth_multiplier <= 0: raise ValueError('depth_multiplier is not greater than zero.') if conv_defs is None: conv_defs = MOBILENETV1_CONV_DEFS if output_stride is not None and output_stride not in [8, 16, 32]: raise ValueError('Only allowed output_stride values are 8, 16, 32.') padding = 'SAME' if use_explicit_padding: padding = 'VALID' with tf.variable_scope(scope, 'MobilenetV1', [inputs]): with slim.arg_scope([slim.conv2d, slim.separable_conv2d], padding=padding): # The current_stride variable keeps track of the output stride of the # activations, i.e., the running product of convolution strides up to the # current network layer. This allows us to invoke atrous convolution # whenever applying the next convolution would result in the activations # having output stride larger than the target output_stride. current_stride = 1 # The atrous convolution rate parameter. rate = 1 net = inputs for i, conv_def in enumerate(conv_defs): end_point_base = 'Conv2d_%d' % i if output_stride is not None and current_stride == output_stride: # If we have reached the target output_stride, then we need to employ # atrous convolution with stride=1 and multiply the atrous rate by the # current unit's stride for use in subsequent layers. layer_stride = 1 layer_rate = rate rate *= conv_def.stride else: layer_stride = conv_def.stride layer_rate = 1 current_stride *= conv_def.stride if isinstance(conv_def, Conv): end_point = end_point_base if use_explicit_padding: net = _fixed_padding(net, conv_def.kernel) net = slim.conv2d(net, depth(conv_def.depth), conv_def.kernel, stride=conv_def.stride, scope=end_point) end_points[end_point] = net if end_point == final_endpoint: return net, end_points elif isinstance(conv_def, DepthSepConv): end_point = end_point_base + '_depthwise' # By passing filters=None # separable_conv2d produces only a depthwise convolution layer if use_explicit_padding: net = _fixed_padding(net, conv_def.kernel, layer_rate) net = slim.separable_conv2d(net, None, conv_def.kernel, depth_multiplier=1, stride=layer_stride, rate=layer_rate, scope=end_point) end_points[end_point] = net if end_point == final_endpoint: return net, end_points end_point = end_point_base + '_pointwise' net = slim.conv2d(net, depth(conv_def.depth), [1, 1], stride=1, scope=end_point) end_points[end_point] = net if end_point == final_endpoint: return net, end_points else: raise ValueError('Unknown convolution type %s for layer %d' % (conv_def.ltype, i)) raise ValueError('Unknown final endpoint %s' % final_endpoint) def mobilenet_v1(inputs, num_classes=1000, dropout_keep_prob=0.999, is_training=True, min_depth=8, depth_multiplier=1.0, conv_defs=None, prediction_fn=tf.contrib.layers.softmax, spatial_squeeze=True, reuse=None, scope='MobilenetV1', global_pool=False): """Mobilenet v1 model for classification. Args: inputs: a tensor of shape [batch_size, height, width, channels]. num_classes: number of predicted classes. If 0 or None, the logits layer is omitted and the input features to the logits layer (before dropout) are returned instead. dropout_keep_prob: the percentage of activation values that are retained. is_training: whether is training or not. min_depth: Minimum depth value (number of channels) for all convolution ops. Enforced when depth_multiplier < 1, and not an active constraint when depth_multiplier >= 1. depth_multiplier: Float multiplier for the depth (number of channels) for all convolution ops. The value must be greater than zero. Typical usage will be to set this value in (0, 1) to reduce the number of parameters or computation cost of the model. conv_defs: A list of ConvDef namedtuples specifying the net architecture. prediction_fn: a function to get predictions out of logits. spatial_squeeze: if True, logits is of shape is [B, C], if false logits is of shape [B, 1, 1, C], where B is batch_size and C is number of classes. reuse: whether or not the network and its variables should be reused. To be able to reuse 'scope' must be given. scope: Optional variable_scope. global_pool: Optional boolean flag to control the avgpooling before the logits layer. If false or unset, pooling is done with a fixed window that reduces default-sized inputs to 1x1, while larger inputs lead to larger outputs. If true, any input size is pooled down to 1x1. Returns: net: a 2D Tensor with the logits (pre-softmax activations) if num_classes is a non-zero integer, or the non-dropped-out input to the logits layer if num_classes is 0 or None. end_points: a dictionary from components of the network to the corresponding activation. Raises: ValueError: Input rank is invalid. """ input_shape = inputs.get_shape().as_list() if len(input_shape) != 4: raise ValueError('Invalid input tensor rank, expected 4, was: %d' % len(input_shape)) with tf.variable_scope(scope, 'MobilenetV1', [inputs], reuse=reuse) as scope: with slim.arg_scope([slim.batch_norm, slim.dropout], is_training=is_training): net, end_points = mobilenet_v1_base(inputs, scope=scope, min_depth=min_depth, depth_multiplier=depth_multiplier, conv_defs=conv_defs) with tf.variable_scope('Logits'): if global_pool: # Global average pooling. net = tf.reduce_mean(net, [1, 2], keep_dims=True, name='global_pool') end_points['global_pool'] = net else: # Pooling with a fixed kernel size. kernel_size = _reduced_kernel_size_for_small_input(net, [7, 7]) net = slim.avg_pool2d(net, kernel_size, padding='VALID', scope='AvgPool_1a') end_points['AvgPool_1a'] = net if not num_classes: return net, end_points # 1 x 1 x 1024 net = slim.dropout(net, keep_prob=dropout_keep_prob, scope='Dropout_1b') logits = slim.conv2d(net, num_classes, [1, 1], activation_fn=None, normalizer_fn=None, scope='Conv2d_1c_1x1') if spatial_squeeze: logits = tf.squeeze(logits, [1, 2], name='SpatialSqueeze') end_points['Logits'] = logits if prediction_fn: end_points['Predictions'] = prediction_fn(logits, scope='Predictions') return logits, end_points mobilenet_v1.default_image_size = 224 def wrapped_partial(func, *args, **kwargs): partial_func = functools.partial(func, *args, **kwargs) functools.update_wrapper(partial_func, func) return partial_func mobilenet_v1_075 = wrapped_partial(mobilenet_v1, depth_multiplier=0.75) mobilenet_v1_050 = wrapped_partial(mobilenet_v1, depth_multiplier=0.50) mobilenet_v1_025 = wrapped_partial(mobilenet_v1, depth_multiplier=0.25) def _reduced_kernel_size_for_small_input(input_tensor, kernel_size): """Define kernel size which is automatically reduced for small input. If the shape of the input images is unknown at graph construction time this function assumes that the input images are large enough. Args: input_tensor: input tensor of size [batch_size, height, width, channels]. kernel_size: desired kernel size of length 2: [kernel_height, kernel_width] Returns: a tensor with the kernel size. """ shape = input_tensor.get_shape().as_list() if shape[1] is None or shape[2] is None: kernel_size_out = kernel_size else: kernel_size_out = [min(shape[1], kernel_size[0]), min(shape[2], kernel_size[1])] return kernel_size_out def mobilenet_v1_arg_scope( is_training=True, weight_decay=0.00004, stddev=0.09, regularize_depthwise=False, batch_norm_decay=0.9997, batch_norm_epsilon=0.001, batch_norm_updates_collections=tf.GraphKeys.UPDATE_OPS, normalizer_fn=slim.batch_norm): """Defines the default MobilenetV1 arg scope. Args: is_training: Whether or not we're training the model. If this is set to None, the parameter is not added to the batch_norm arg_scope. weight_decay: The weight decay to use for regularizing the model. stddev: The standard deviation of the trunctated normal weight initializer. regularize_depthwise: Whether or not apply regularization on depthwise. batch_norm_decay: Decay for batch norm moving average. batch_norm_epsilon: Small float added to variance to avoid dividing by zero in batch norm. batch_norm_updates_collections: Collection for the update ops for batch norm. normalizer_fn: Normalization function to apply after convolution. Returns: An `arg_scope` to use for the mobilenet v1 model. """ batch_norm_params = { 'center': True, 'scale': True, 'decay': batch_norm_decay, 'epsilon': batch_norm_epsilon, 'updates_collections': batch_norm_updates_collections, } if is_training is not None: batch_norm_params['is_training'] = is_training # Set weight_decay for weights in Conv and DepthSepConv layers. weights_init = tf.truncated_normal_initializer(stddev=stddev) regularizer = tf.contrib.layers.l2_regularizer(weight_decay) if regularize_depthwise: depthwise_regularizer = regularizer else: depthwise_regularizer = None with slim.arg_scope([slim.conv2d, slim.separable_conv2d], weights_initializer=weights_init, activation_fn=tf.nn.relu6, normalizer_fn=normalizer_fn): with slim.arg_scope([slim.batch_norm], **batch_norm_params): with slim.arg_scope([slim.conv2d], weights_regularizer=regularizer): with slim.arg_scope([slim.separable_conv2d], weights_regularizer=depthwise_regularizer) as sc: return sc
PyTorch/SpeechSynthesis/Tacotron2/trtis_cpp/src/trt/util
util
dataShuffler
/* * Copyright (c) 2019-2020, NVIDIA CORPORATION. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * Neither the name of the NVIDIA CORPORATION nor the * names of its contributors may be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE FOR ANY * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef TT2I_DATASHUFFLE_H #define TT2I_DATASHUFFLE_H #include "cuda_runtime.h" #include <stdint.h> namespace tts { class DataShuffler { public: /** * @brief Take decoder output in TN(C+G) output, where C contains the 80 mel * channels and G is the 1 gate output, and output a NCT tensor and gate * tensor NGT. * * @param in The input matrix. * @param out The tranposed matrix (output). * @param gateOut The gate tensor (output). * @param batchSize The batch size. * @param chunkSize The number of frames. * @param numChannels The number of channels (excluding the output gate). * @param stream The stream to perform the operation in. */ static void parseDecoderOutput(const float* in, float* out, float* gateOut, int batchSize, int chunkSize, int numChannels, cudaStream_t stream); /** * @brief Tranpose a matrix on the GPU. * * @param in The input matrix. * @param out The tranposed matrix (output). * @param nRows The number of rows. * @param nCols The number of columns. * @param stream The stream to perform the operation in. */ static void transposeMatrix(const float* in, float* out, int nRows, int nCols, cudaStream_t stream); /** * @brief Shuffle the mel-spectrograms in output, so that it goes from Chunk, * Batch, Channel ordering, to Batch, Chunk, Channel, and each sequence to the * specified compactLength. * * @param in The input. * @param out The shuffled output. * @param batchSize The size of the batch. * @param numChannels The number of channels per frame. * @param chunkSize The number of frames per chunk. * @param numChunks The number of chunks. * @param compactLength The length to compact to. * @param stream The stream to operate on. */ static void shuffleMels(const float* in, float* out, int batchSize, int numChannels, int chunkSize, int numChunks, int compactLength, cudaStream_t stream); /** * @brief Scatter a frame of data across several different sequences. * * @param in The input frames. * @param out The output frames. * @param inputSequenceSpacing The spacing between the start of each * input sequence. * @param inputSequenceOffset The offset within each input sequence where * the chunks will be taken from. * @param chunkSize The size of each chunk. * @param numChunks The number of chunks. * @param outputSequenceSpacing The spacing between the start of each * output sequence. * @param outputSequenceOffset The offset within each output sequence where * the chunks will be placed. * @param stream The stream to operate on. */ static void frameTransfer(const float* in, float* out, int inputSequenceSpacing, int inputSequenceOffset, int chunkSize, int numChunks, int outputSequenceSpacing, int outputSequenceOffset, cudaStream_t stream); }; } // namespace tts #endif
TensorFlow/Detection/SSD/models/research/object_detection/anchor_generators
anchor_generators
multiple_grid_anchor_generator_test
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== """Tests for anchor_generators.multiple_grid_anchor_generator_test.py.""" import numpy as np import tensorflow as tf from object_detection.anchor_generators import multiple_grid_anchor_generator as ag from object_detection.utils import test_case class MultipleGridAnchorGeneratorTest(test_case.TestCase): def test_construct_single_anchor_grid(self): """Builds a 1x1 anchor grid to test the size of the output boxes.""" def graph_fn(): box_specs_list = [[(.5, .25), (1.0, .25), (2.0, .25), (.5, 1.0), (1.0, 1.0), (2.0, 1.0), (.5, 4.0), (1.0, 4.0), (2.0, 4.0)]] anchor_generator = ag.MultipleGridAnchorGenerator( box_specs_list, base_anchor_size=tf.constant([256, 256], dtype=tf.float32), anchor_strides=[(16, 16)], anchor_offsets=[(7, -3)]) anchors_list = anchor_generator.generate(feature_map_shape_list=[(1, 1)]) return anchors_list[0].get() exp_anchor_corners = [[-121, -35, 135, 29], [-249, -67, 263, 61], [-505, -131, 519, 125], [-57, -67, 71, 61], [-121, -131, 135, 125], [-249, -259, 263, 253], [-25, -131, 39, 125], [-57, -259, 71, 253], [-121, -515, 135, 509]] anchor_corners_out = self.execute(graph_fn, []) self.assertAllClose(anchor_corners_out, exp_anchor_corners) def test_construct_anchor_grid(self): def graph_fn(): box_specs_list = [[(0.5, 1.0), (1.0, 1.0), (2.0, 1.0)]] anchor_generator = ag.MultipleGridAnchorGenerator( box_specs_list, base_anchor_size=tf.constant([10, 10], dtype=tf.float32), anchor_strides=[(19, 19)], anchor_offsets=[(0, 0)]) anchors_list = anchor_generator.generate(feature_map_shape_list=[(2, 2)]) return anchors_list[0].get() exp_anchor_corners = [[-2.5, -2.5, 2.5, 2.5], [-5., -5., 5., 5.], [-10., -10., 10., 10.], [-2.5, 16.5, 2.5, 21.5], [-5., 14., 5, 24], [-10., 9., 10, 29], [16.5, -2.5, 21.5, 2.5], [14., -5., 24, 5], [9., -10., 29, 10], [16.5, 16.5, 21.5, 21.5], [14., 14., 24, 24], [9., 9., 29, 29]] anchor_corners_out = self.execute(graph_fn, []) self.assertAllClose(anchor_corners_out, exp_anchor_corners) def test_construct_anchor_grid_non_square(self): def graph_fn(): box_specs_list = [[(1.0, 1.0)]] anchor_generator = ag.MultipleGridAnchorGenerator( box_specs_list, base_anchor_size=tf.constant([1, 1], dtype=tf.float32)) anchors_list = anchor_generator.generate(feature_map_shape_list=[( tf.constant(1, dtype=tf.int32), tf.constant(2, dtype=tf.int32))]) return anchors_list[0].get() exp_anchor_corners = [[0., -0.25, 1., 0.75], [0., 0.25, 1., 1.25]] anchor_corners_out = self.execute(graph_fn, []) self.assertAllClose(anchor_corners_out, exp_anchor_corners) def test_construct_dynamic_size_anchor_grid(self): def graph_fn(height, width): box_specs_list = [[(1.0, 1.0)]] anchor_generator = ag.MultipleGridAnchorGenerator( box_specs_list, base_anchor_size=tf.constant([1, 1], dtype=tf.float32)) anchors_list = anchor_generator.generate(feature_map_shape_list=[(height, width)]) return anchors_list[0].get() exp_anchor_corners = [[0., -0.25, 1., 0.75], [0., 0.25, 1., 1.25]] anchor_corners_out = self.execute_cpu(graph_fn, [np.array(1, dtype=np.int32), np.array(2, dtype=np.int32)]) self.assertAllClose(anchor_corners_out, exp_anchor_corners) def test_construct_anchor_grid_normalized(self): def graph_fn(): box_specs_list = [[(1.0, 1.0)]] anchor_generator = ag.MultipleGridAnchorGenerator( box_specs_list, base_anchor_size=tf.constant([1, 1], dtype=tf.float32)) anchors_list = anchor_generator.generate( feature_map_shape_list=[(tf.constant(1, dtype=tf.int32), tf.constant( 2, dtype=tf.int32))], im_height=320, im_width=640) return anchors_list[0].get() exp_anchor_corners = [[0., 0., 1., 0.5], [0., 0.5, 1., 1.]] anchor_corners_out = self.execute(graph_fn, []) self.assertAllClose(anchor_corners_out, exp_anchor_corners) def test_construct_multiple_grids(self): def graph_fn(): box_specs_list = [[(1.0, 1.0), (2.0, 1.0), (1.0, 0.5)], [(1.0, 1.0), (1.0, 0.5)]] anchor_generator = ag.MultipleGridAnchorGenerator( box_specs_list, base_anchor_size=tf.constant([1.0, 1.0], dtype=tf.float32), anchor_strides=[(.25, .25), (.5, .5)], anchor_offsets=[(.125, .125), (.25, .25)]) anchors_list = anchor_generator.generate(feature_map_shape_list=[(4, 4), ( 2, 2)]) return [anchors.get() for anchors in anchors_list] # height and width of box with .5 aspect ratio h = np.sqrt(2) w = 1.0/np.sqrt(2) exp_small_grid_corners = [[-.25, -.25, .75, .75], [.25-.5*h, .25-.5*w, .25+.5*h, .25+.5*w], [-.25, .25, .75, 1.25], [.25-.5*h, .75-.5*w, .25+.5*h, .75+.5*w], [.25, -.25, 1.25, .75], [.75-.5*h, .25-.5*w, .75+.5*h, .25+.5*w], [.25, .25, 1.25, 1.25], [.75-.5*h, .75-.5*w, .75+.5*h, .75+.5*w]] # only test first entry of larger set of anchors exp_big_grid_corners = [[.125-.5, .125-.5, .125+.5, .125+.5], [.125-1.0, .125-1.0, .125+1.0, .125+1.0], [.125-.5*h, .125-.5*w, .125+.5*h, .125+.5*w],] anchor_corners_out = np.concatenate(self.execute(graph_fn, []), axis=0) self.assertEquals(anchor_corners_out.shape, (56, 4)) big_grid_corners = anchor_corners_out[0:3, :] small_grid_corners = anchor_corners_out[48:, :] self.assertAllClose(small_grid_corners, exp_small_grid_corners) self.assertAllClose(big_grid_corners, exp_big_grid_corners) def test_construct_multiple_grids_with_clipping(self): def graph_fn(): box_specs_list = [[(1.0, 1.0), (2.0, 1.0), (1.0, 0.5)], [(1.0, 1.0), (1.0, 0.5)]] clip_window = tf.constant([0, 0, 1, 1], dtype=tf.float32) anchor_generator = ag.MultipleGridAnchorGenerator( box_specs_list, base_anchor_size=tf.constant([1.0, 1.0], dtype=tf.float32), clip_window=clip_window) anchors_list = anchor_generator.generate(feature_map_shape_list=[(4, 4), ( 2, 2)]) return [anchors.get() for anchors in anchors_list] # height and width of box with .5 aspect ratio h = np.sqrt(2) w = 1.0/np.sqrt(2) exp_small_grid_corners = [[0, 0, .75, .75], [0, 0, .25+.5*h, .25+.5*w], [0, .25, .75, 1], [0, .75-.5*w, .25+.5*h, 1], [.25, 0, 1, .75], [.75-.5*h, 0, 1, .25+.5*w], [.25, .25, 1, 1], [.75-.5*h, .75-.5*w, 1, 1]] anchor_corners_out = np.concatenate(self.execute(graph_fn, []), axis=0) small_grid_corners = anchor_corners_out[48:, :] self.assertAllClose(small_grid_corners, exp_small_grid_corners) def test_invalid_box_specs(self): # not all box specs are pairs box_specs_list = [[(1.0, 1.0), (2.0, 1.0), (1.0, 0.5)], [(1.0, 1.0), (1.0, 0.5, .3)]] with self.assertRaises(ValueError): ag.MultipleGridAnchorGenerator(box_specs_list) # box_specs_list is not a list of lists box_specs_list = [(1.0, 1.0), (2.0, 1.0), (1.0, 0.5)] with self.assertRaises(ValueError): ag.MultipleGridAnchorGenerator(box_specs_list) def test_invalid_generate_arguments(self): box_specs_list = [[(1.0, 1.0), (2.0, 1.0), (1.0, 0.5)], [(1.0, 1.0), (1.0, 0.5)]] # incompatible lengths with box_specs_list with self.assertRaises(ValueError): anchor_generator = ag.MultipleGridAnchorGenerator( box_specs_list, base_anchor_size=tf.constant([1.0, 1.0], dtype=tf.float32), anchor_strides=[(.25, .25)], anchor_offsets=[(.125, .125), (.25, .25)]) anchor_generator.generate(feature_map_shape_list=[(4, 4), (2, 2)]) with self.assertRaises(ValueError): anchor_generator = ag.MultipleGridAnchorGenerator( box_specs_list, base_anchor_size=tf.constant([1.0, 1.0], dtype=tf.float32), anchor_strides=[(.25, .25), (.5, .5)], anchor_offsets=[(.125, .125), (.25, .25)]) anchor_generator.generate(feature_map_shape_list=[(4, 4), (2, 2), (1, 1)]) with self.assertRaises(ValueError): anchor_generator = ag.MultipleGridAnchorGenerator( box_specs_list, base_anchor_size=tf.constant([1.0, 1.0], dtype=tf.float32), anchor_strides=[(.5, .5)], anchor_offsets=[(.25, .25)]) anchor_generator.generate(feature_map_shape_list=[(4, 4), (2, 2)]) # not pairs with self.assertRaises(ValueError): anchor_generator = ag.MultipleGridAnchorGenerator( box_specs_list, base_anchor_size=tf.constant([1.0, 1.0], dtype=tf.float32), anchor_strides=[(.25, .25), (.5, .5)], anchor_offsets=[(.125, .125), (.25, .25)]) anchor_generator.generate(feature_map_shape_list=[(4, 4, 4), (2, 2)]) with self.assertRaises(ValueError): anchor_generator = ag.MultipleGridAnchorGenerator( box_specs_list, base_anchor_size=tf.constant([1.0, 1.0], dtype=tf.float32), anchor_strides=[(.25, .25, .1), (.5, .5)], anchor_offsets=[(.125, .125), (.25, .25)]) anchor_generator.generate(feature_map_shape_list=[(4, 4), (2, 2)]) with self.assertRaises(ValueError): anchor_generator = ag.MultipleGridAnchorGenerator( box_specs_list, base_anchor_size=tf.constant([1.0, 1.0], dtype=tf.float32), anchor_strides=[(.25, .25), (.5, .5)], anchor_offsets=[(.125, .125), (.25, .25)]) anchor_generator.generate(feature_map_shape_list=[(4), (2, 2)]) class CreateSSDAnchorsTest(test_case.TestCase): def test_create_ssd_anchors_returns_correct_shape(self): def graph_fn1(): anchor_generator = ag.create_ssd_anchors( num_layers=6, min_scale=0.2, max_scale=0.95, aspect_ratios=(1.0, 2.0, 3.0, 1.0 / 2, 1.0 / 3), reduce_boxes_in_lowest_layer=True) feature_map_shape_list = [(38, 38), (19, 19), (10, 10), (5, 5), (3, 3), (1, 1)] anchors_list = anchor_generator.generate( feature_map_shape_list=feature_map_shape_list) return [anchors.get() for anchors in anchors_list] anchor_corners_out = np.concatenate(self.execute(graph_fn1, []), axis=0) self.assertEquals(anchor_corners_out.shape, (7308, 4)) def graph_fn2(): anchor_generator = ag.create_ssd_anchors( num_layers=6, min_scale=0.2, max_scale=0.95, aspect_ratios=(1.0, 2.0, 3.0, 1.0/2, 1.0/3), reduce_boxes_in_lowest_layer=False) feature_map_shape_list = [(38, 38), (19, 19), (10, 10), (5, 5), (3, 3), (1, 1)] anchors_list = anchor_generator.generate( feature_map_shape_list=feature_map_shape_list) return [anchors.get() for anchors in anchors_list] anchor_corners_out = np.concatenate(self.execute(graph_fn2, []), axis=0) self.assertEquals(anchor_corners_out.shape, (11640, 4)) if __name__ == '__main__': tf.test.main()
CUDA-Optimized/FastSpeech/fastspeech/hparams
hparams
train_amp
# Inheritance parent_yaml: "train.yaml" # Path log_path: "" checkpoint_path: "" # Train final_steps: 25 log_step: 1 use_amp: True nvprof_iter_start: 5 nvprof_iter_end: 25 pyprof_enabled: False
TensorFlow/Detection/SSD/models/research/object_detection/dataset_tools
dataset_tools
create_pycocotools_package
#!/bin/bash # Copyright 2018 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== # Script to download pycocotools and make package for CMLE jobs. # # usage: # bash object_detection/dataset_tools/create_pycocotools_package.sh \ # /tmp/pycocotools set -e if [ -z "$1" ]; then echo "usage create_pycocotools_package.sh [output dir]" exit fi # Create the output directory. OUTPUT_DIR="${1%/}" SCRATCH_DIR="${OUTPUT_DIR}/raw" mkdir -p "${OUTPUT_DIR}" mkdir -p "${SCRATCH_DIR}" cd ${SCRATCH_DIR} git clone https://github.com/cocodataset/cocoapi.git cd cocoapi/PythonAPI && mv ../common ./ sed "s/\.\.\/common/common/g" setup.py > setup.py.updated cp -f setup.py.updated setup.py rm setup.py.updated sed "s/\.\.\/common/common/g" pycocotools/_mask.pyx > _mask.pyx.updated cp -f _mask.pyx.updated pycocotools/_mask.pyx rm _mask.pyx.updated sed "s/import matplotlib\.pyplot as plt/import matplotlib\nmatplotlib\.use\(\'Agg\'\)\nimport matplotlib\.pyplot as plt/g" pycocotools/coco.py > coco.py.updated cp -f coco.py.updated pycocotools/coco.py rm coco.py.updated cd "${OUTPUT_DIR}" tar -czf pycocotools-2.0.tar.gz -C "${SCRATCH_DIR}/cocoapi/" PythonAPI/ rm -rf ${SCRATCH_DIR}
PyTorch/LanguageModeling/BERT/triton/runner/maintainer/docker
docker
__init__
# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License.
TensorFlow2/Classification/ConvNets/efficientnet_v1/B4/training/FP32
FP32
train_benchmark_8xV100-32G
# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. horovodrun -np 8 bash ./scripts/bind.sh --cpu=exclusive --ib=single -- python3 main.py \ --cfg config/efficientnet_v1/b4_cfg.py \ --mode train_and_eval \ --use_xla \ --model_dir ./output \ --data_dir /data \ --log_steps 100 \ --max_epochs 2 \ --save_checkpoint_freq 5 \ --train_batch_size 32 \ --eval_batch_size 32 \ --train_img_size 380 \ --eval_img_size 380 \ --augmenter_name autoaugment \ --lr_decay cosine \ --mixup_alpha 0.2 \ --defer_img_mixing \ --moving_average_decay 0.9999 \ --lr_init 0.005
TensorFlow/Detection/SSD/models/research/object_detection
object_detection
inputs
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== # # Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. """Model input function for tf-learn object detection model.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import functools import tensorflow as tf from object_detection.builders import dataset_builder from object_detection.builders import image_resizer_builder from object_detection.builders import model_builder from object_detection.builders import preprocessor_builder from object_detection.core import preprocessor from object_detection.core import standard_fields as fields from object_detection.data_decoders import tf_example_decoder from object_detection.protos import eval_pb2 from object_detection.protos import input_reader_pb2 from object_detection.protos import model_pb2 from object_detection.protos import train_pb2 from object_detection.utils import config_util from object_detection.utils import ops as util_ops from object_detection.utils import shape_utils HASH_KEY = 'hash' HASH_BINS = 1 << 31 SERVING_FED_EXAMPLE_KEY = 'serialized_example' # A map of names to methods that help build the input pipeline. INPUT_BUILDER_UTIL_MAP = { 'dataset_build': dataset_builder.build, } def transform_input_data(tensor_dict, model_preprocess_fn, image_resizer_fn, num_classes, data_augmentation_fn=None, merge_multiple_boxes=False, retain_original_image=False, use_bfloat16=False): """A single function that is responsible for all input data transformations. Data transformation functions are applied in the following order. 1. If key fields.InputDataFields.image_additional_channels is present in tensor_dict, the additional channels will be merged into fields.InputDataFields.image. 2. data_augmentation_fn (optional): applied on tensor_dict. 3. model_preprocess_fn: applied only on image tensor in tensor_dict. 4. image_resizer_fn: applied on original image and instance mask tensor in tensor_dict. 5. one_hot_encoding: applied to classes tensor in tensor_dict. 6. merge_multiple_boxes (optional): when groundtruth boxes are exactly the same they can be merged into a single box with an associated k-hot class label. Args: tensor_dict: dictionary containing input tensors keyed by fields.InputDataFields. model_preprocess_fn: model's preprocess function to apply on image tensor. This function must take in a 4-D float tensor and return a 4-D preprocess float tensor and a tensor containing the true image shape. image_resizer_fn: image resizer function to apply on groundtruth instance `masks. This function must take a 3-D float tensor of an image and a 3-D tensor of instance masks and return a resized version of these along with the true shapes. num_classes: number of max classes to one-hot (or k-hot) encode the class labels. data_augmentation_fn: (optional) data augmentation function to apply on input `tensor_dict`. merge_multiple_boxes: (optional) whether to merge multiple groundtruth boxes and classes for a given image if the boxes are exactly the same. retain_original_image: (optional) whether to retain original image in the output dictionary. use_bfloat16: (optional) a bool, whether to use bfloat16 in training. Returns: A dictionary keyed by fields.InputDataFields containing the tensors obtained after applying all the transformations. """ if fields.InputDataFields.groundtruth_boxes in tensor_dict: tensor_dict = util_ops.filter_groundtruth_with_nan_box_coordinates( tensor_dict) if fields.InputDataFields.image_additional_channels in tensor_dict: channels = tensor_dict[fields.InputDataFields.image_additional_channels] tensor_dict[fields.InputDataFields.image] = tf.concat( [tensor_dict[fields.InputDataFields.image], channels], axis=2) if retain_original_image: tensor_dict[fields.InputDataFields.original_image] = tf.cast( image_resizer_fn(tensor_dict[fields.InputDataFields.image], None)[0], tf.uint8) # Apply data augmentation ops. if data_augmentation_fn is not None: tensor_dict = data_augmentation_fn(tensor_dict) # Apply model preprocessing ops and resize instance masks. image = tensor_dict[fields.InputDataFields.image] preprocessed_resized_image, true_image_shape = model_preprocess_fn( tf.expand_dims(tf.to_float(image), axis=0)) if use_bfloat16: preprocessed_resized_image = tf.cast( preprocessed_resized_image, tf.bfloat16) tensor_dict[fields.InputDataFields.image] = tf.squeeze( preprocessed_resized_image, axis=0) tensor_dict[fields.InputDataFields.true_image_shape] = tf.squeeze( true_image_shape, axis=0) if fields.InputDataFields.groundtruth_instance_masks in tensor_dict: masks = tensor_dict[fields.InputDataFields.groundtruth_instance_masks] _, resized_masks, _ = image_resizer_fn(image, masks) if use_bfloat16: resized_masks = tf.cast(resized_masks, tf.bfloat16) tensor_dict[fields.InputDataFields. groundtruth_instance_masks] = resized_masks # Transform groundtruth classes to one hot encodings. label_offset = 1 zero_indexed_groundtruth_classes = tensor_dict[ fields.InputDataFields.groundtruth_classes] - label_offset tensor_dict[fields.InputDataFields.groundtruth_classes] = tf.one_hot( zero_indexed_groundtruth_classes, num_classes) if fields.InputDataFields.groundtruth_confidences in tensor_dict: groundtruth_confidences = tensor_dict[ fields.InputDataFields.groundtruth_confidences] # Map the confidences to the one-hot encoding of classes tensor_dict[fields.InputDataFields.groundtruth_confidences] = ( tf.reshape(groundtruth_confidences, [-1, 1]) * tensor_dict[fields.InputDataFields.groundtruth_classes]) else: groundtruth_confidences = tf.ones_like( zero_indexed_groundtruth_classes, dtype=tf.float32) tensor_dict[fields.InputDataFields.groundtruth_confidences] = ( tensor_dict[fields.InputDataFields.groundtruth_classes]) if merge_multiple_boxes: merged_boxes, merged_classes, merged_confidences, _ = ( util_ops.merge_boxes_with_multiple_labels( tensor_dict[fields.InputDataFields.groundtruth_boxes], zero_indexed_groundtruth_classes, groundtruth_confidences, num_classes)) merged_classes = tf.cast(merged_classes, tf.float32) tensor_dict[fields.InputDataFields.groundtruth_boxes] = merged_boxes tensor_dict[fields.InputDataFields.groundtruth_classes] = merged_classes tensor_dict[fields.InputDataFields.groundtruth_confidences] = ( merged_confidences) if fields.InputDataFields.groundtruth_boxes in tensor_dict: tensor_dict[fields.InputDataFields.num_groundtruth_boxes] = tf.shape( tensor_dict[fields.InputDataFields.groundtruth_boxes])[0] return tensor_dict def pad_input_data_to_static_shapes(tensor_dict, max_num_boxes, num_classes, spatial_image_shape=None): """Pads input tensors to static shapes. Args: tensor_dict: Tensor dictionary of input data max_num_boxes: Max number of groundtruth boxes needed to compute shapes for padding. num_classes: Number of classes in the dataset needed to compute shapes for padding. spatial_image_shape: A list of two integers of the form [height, width] containing expected spatial shape of the image. Returns: A dictionary keyed by fields.InputDataFields containing padding shapes for tensors in the dataset. Raises: ValueError: If groundtruth classes is neither rank 1 nor rank 2. """ if not spatial_image_shape or spatial_image_shape == [-1, -1]: height, width = None, None else: height, width = spatial_image_shape # pylint: disable=unpacking-non-sequence num_additional_channels = 0 if fields.InputDataFields.image_additional_channels in tensor_dict: num_additional_channels = tensor_dict[ fields.InputDataFields.image_additional_channels].shape[2].value num_image_channels = 3 if fields.InputDataFields.image in tensor_dict: num_image_channels = tensor_dict[fields.InputDataFields .image].shape[2].value padding_shapes = { # Additional channels are merged before batching. fields.InputDataFields.image: [ height, width, num_image_channels + num_additional_channels ], fields.InputDataFields.original_image_spatial_shape: [2], fields.InputDataFields.image_additional_channels: [ height, width, num_additional_channels ], fields.InputDataFields.source_id: [], fields.InputDataFields.filename: [], fields.InputDataFields.key: [], fields.InputDataFields.groundtruth_difficult: [max_num_boxes], fields.InputDataFields.groundtruth_boxes: [max_num_boxes, 4], fields.InputDataFields.groundtruth_classes: [max_num_boxes, num_classes], fields.InputDataFields.groundtruth_instance_masks: [ max_num_boxes, height, width ], fields.InputDataFields.groundtruth_is_crowd: [max_num_boxes], fields.InputDataFields.groundtruth_group_of: [max_num_boxes], fields.InputDataFields.groundtruth_area: [max_num_boxes], fields.InputDataFields.groundtruth_weights: [max_num_boxes], fields.InputDataFields.groundtruth_confidences: [ max_num_boxes, num_classes ], fields.InputDataFields.num_groundtruth_boxes: [], fields.InputDataFields.groundtruth_label_types: [max_num_boxes], fields.InputDataFields.groundtruth_label_weights: [max_num_boxes], fields.InputDataFields.true_image_shape: [3], fields.InputDataFields.multiclass_scores: [ max_num_boxes, num_classes + 1 if num_classes is not None else None ], fields.InputDataFields.groundtruth_image_classes: [num_classes], fields.InputDataFields.groundtruth_image_confidences: [num_classes], } if fields.InputDataFields.original_image in tensor_dict: padding_shapes[fields.InputDataFields.original_image] = [ height, width, num_image_channels + num_additional_channels ] if fields.InputDataFields.groundtruth_keypoints in tensor_dict: tensor_shape = ( tensor_dict[fields.InputDataFields.groundtruth_keypoints].shape) padding_shape = [max_num_boxes, tensor_shape[1].value, tensor_shape[2].value] padding_shapes[fields.InputDataFields.groundtruth_keypoints] = padding_shape if fields.InputDataFields.groundtruth_keypoint_visibilities in tensor_dict: tensor_shape = tensor_dict[fields.InputDataFields. groundtruth_keypoint_visibilities].shape padding_shape = [max_num_boxes, tensor_shape[1].value] padding_shapes[fields.InputDataFields. groundtruth_keypoint_visibilities] = padding_shape padded_tensor_dict = {} for tensor_name in tensor_dict: padded_tensor_dict[tensor_name] = shape_utils.pad_or_clip_nd( tensor_dict[tensor_name], padding_shapes[tensor_name]) # Make sure that the number of groundtruth boxes now reflects the # padded/clipped tensors. if fields.InputDataFields.num_groundtruth_boxes in padded_tensor_dict: padded_tensor_dict[fields.InputDataFields.num_groundtruth_boxes] = ( tf.minimum( padded_tensor_dict[fields.InputDataFields.num_groundtruth_boxes], max_num_boxes)) return padded_tensor_dict def augment_input_data(tensor_dict, data_augmentation_options): """Applies data augmentation ops to input tensors. Args: tensor_dict: A dictionary of input tensors keyed by fields.InputDataFields. data_augmentation_options: A list of tuples, where each tuple contains a function and a dictionary that contains arguments and their values. Usually, this is the output of core/preprocessor.build. Returns: A dictionary of tensors obtained by applying data augmentation ops to the input tensor dictionary. """ tensor_dict[fields.InputDataFields.image] = tf.expand_dims( tf.to_float(tensor_dict[fields.InputDataFields.image]), 0) include_instance_masks = (fields.InputDataFields.groundtruth_instance_masks in tensor_dict) include_keypoints = (fields.InputDataFields.groundtruth_keypoints in tensor_dict) include_label_weights = (fields.InputDataFields.groundtruth_weights in tensor_dict) include_label_confidences = (fields.InputDataFields.groundtruth_confidences in tensor_dict) tensor_dict = preprocessor.preprocess( tensor_dict, data_augmentation_options, func_arg_map=preprocessor.get_default_func_arg_map( include_label_weights=include_label_weights, include_label_confidences=include_label_confidences, include_instance_masks=include_instance_masks, include_keypoints=include_keypoints)) tensor_dict[fields.InputDataFields.image] = tf.squeeze( tensor_dict[fields.InputDataFields.image], axis=0) return tensor_dict def _get_labels_dict(input_dict): """Extracts labels dict from input dict.""" required_label_keys = [ fields.InputDataFields.num_groundtruth_boxes, fields.InputDataFields.groundtruth_boxes, fields.InputDataFields.groundtruth_classes, fields.InputDataFields.groundtruth_weights, ] labels_dict = {} for key in required_label_keys: labels_dict[key] = input_dict[key] optional_label_keys = [ fields.InputDataFields.groundtruth_confidences, fields.InputDataFields.groundtruth_keypoints, fields.InputDataFields.groundtruth_instance_masks, fields.InputDataFields.groundtruth_area, fields.InputDataFields.groundtruth_is_crowd, fields.InputDataFields.groundtruth_difficult ] for key in optional_label_keys: if key in input_dict: labels_dict[key] = input_dict[key] if fields.InputDataFields.groundtruth_difficult in labels_dict: labels_dict[fields.InputDataFields.groundtruth_difficult] = tf.cast( labels_dict[fields.InputDataFields.groundtruth_difficult], tf.int32) return labels_dict def _replace_empty_string_with_random_number(string_tensor): """Returns string unchanged if non-empty, and random string tensor otherwise. The random string is an integer 0 and 2**63 - 1, casted as string. Args: string_tensor: A tf.tensor of dtype string. Returns: out_string: A tf.tensor of dtype string. If string_tensor contains the empty string, out_string will contain a random integer casted to a string. Otherwise string_tensor is returned unchanged. """ empty_string = tf.constant('', dtype=tf.string, name='EmptyString') random_source_id = tf.as_string( tf.random_uniform(shape=[], maxval=2**63 - 1, dtype=tf.int64)) out_string = tf.cond( tf.equal(string_tensor, empty_string), true_fn=lambda: random_source_id, false_fn=lambda: string_tensor) return out_string def _get_features_dict(input_dict): """Extracts features dict from input dict.""" source_id = _replace_empty_string_with_random_number( input_dict[fields.InputDataFields.source_id]) hash_from_source_id = tf.string_to_hash_bucket_fast(source_id, HASH_BINS) features = { fields.InputDataFields.image: input_dict[fields.InputDataFields.image], HASH_KEY: tf.cast(hash_from_source_id, tf.int32), fields.InputDataFields.true_image_shape: input_dict[fields.InputDataFields.true_image_shape], fields.InputDataFields.original_image_spatial_shape: input_dict[fields.InputDataFields.original_image_spatial_shape] } if fields.InputDataFields.original_image in input_dict: features[fields.InputDataFields.original_image] = input_dict[ fields.InputDataFields.original_image] return features def create_train_input_fn(train_config, train_input_config, model_config): """Creates a train `input` function for `Estimator`. Args: train_config: A train_pb2.TrainConfig. train_input_config: An input_reader_pb2.InputReader. model_config: A model_pb2.DetectionModel. Returns: `input_fn` for `Estimator` in TRAIN mode. """ def _train_input_fn(params=None): """Returns `features` and `labels` tensor dictionaries for training. Args: params: Parameter dictionary passed from the estimator. Returns: A tf.data.Dataset that holds (features, labels) tuple. features: Dictionary of feature tensors. features[fields.InputDataFields.image] is a [batch_size, H, W, C] float32 tensor with preprocessed images. features[HASH_KEY] is a [batch_size] int32 tensor representing unique identifiers for the images. features[fields.InputDataFields.true_image_shape] is a [batch_size, 3] int32 tensor representing the true image shapes, as preprocessed images could be padded. features[fields.InputDataFields.original_image] (optional) is a [batch_size, H, W, C] float32 tensor with original images. labels: Dictionary of groundtruth tensors. labels[fields.InputDataFields.num_groundtruth_boxes] is a [batch_size] int32 tensor indicating the number of groundtruth boxes. labels[fields.InputDataFields.groundtruth_boxes] is a [batch_size, num_boxes, 4] float32 tensor containing the corners of the groundtruth boxes. labels[fields.InputDataFields.groundtruth_classes] is a [batch_size, num_boxes, num_classes] float32 one-hot tensor of classes. labels[fields.InputDataFields.groundtruth_weights] is a [batch_size, num_boxes] float32 tensor containing groundtruth weights for the boxes. -- Optional -- labels[fields.InputDataFields.groundtruth_instance_masks] is a [batch_size, num_boxes, H, W] float32 tensor containing only binary values, which represent instance masks for objects. labels[fields.InputDataFields.groundtruth_keypoints] is a [batch_size, num_boxes, num_keypoints, 2] float32 tensor containing keypoints for each box. Raises: TypeError: if the `train_config`, `train_input_config` or `model_config` are not of the correct type. """ if not isinstance(train_config, train_pb2.TrainConfig): raise TypeError('For training mode, the `train_config` must be a ' 'train_pb2.TrainConfig.') if not isinstance(train_input_config, input_reader_pb2.InputReader): raise TypeError('The `train_input_config` must be a ' 'input_reader_pb2.InputReader.') if not isinstance(model_config, model_pb2.DetectionModel): raise TypeError('The `model_config` must be a ' 'model_pb2.DetectionModel.') def transform_and_pad_input_data_fn(tensor_dict): """Combines transform and pad operation.""" data_augmentation_options = [ preprocessor_builder.build(step) for step in train_config.data_augmentation_options ] data_augmentation_fn = functools.partial( augment_input_data, data_augmentation_options=data_augmentation_options) model = model_builder.build(model_config, is_training=True) image_resizer_config = config_util.get_image_resizer_config(model_config) image_resizer_fn = image_resizer_builder.build(image_resizer_config) transform_data_fn = functools.partial( transform_input_data, model_preprocess_fn=model.preprocess, image_resizer_fn=image_resizer_fn, num_classes=config_util.get_number_of_classes(model_config), data_augmentation_fn=data_augmentation_fn, merge_multiple_boxes=train_config.merge_multiple_label_boxes, retain_original_image=train_config.retain_original_images, use_bfloat16=train_config.use_bfloat16) tensor_dict = pad_input_data_to_static_shapes( tensor_dict=transform_data_fn(tensor_dict), max_num_boxes=train_input_config.max_number_of_boxes, num_classes=config_util.get_number_of_classes(model_config), spatial_image_shape=config_util.get_spatial_image_size( image_resizer_config)) return (_get_features_dict(tensor_dict), _get_labels_dict(tensor_dict)) dataset = INPUT_BUILDER_UTIL_MAP['dataset_build']( train_input_config, transform_input_data_fn=transform_and_pad_input_data_fn, batch_size=params['batch_size'] if params else train_config.batch_size, multi_gpu=True) return dataset return _train_input_fn def create_eval_input_fn(eval_config, eval_input_config, model_config): """Creates an eval `input` function for `Estimator`. Args: eval_config: An eval_pb2.EvalConfig. eval_input_config: An input_reader_pb2.InputReader. model_config: A model_pb2.DetectionModel. Returns: `input_fn` for `Estimator` in EVAL mode. """ def _eval_input_fn(params=None): """Returns `features` and `labels` tensor dictionaries for evaluation. Args: params: Parameter dictionary passed from the estimator. Returns: A tf.data.Dataset that holds (features, labels) tuple. features: Dictionary of feature tensors. features[fields.InputDataFields.image] is a [1, H, W, C] float32 tensor with preprocessed images. features[HASH_KEY] is a [1] int32 tensor representing unique identifiers for the images. features[fields.InputDataFields.true_image_shape] is a [1, 3] int32 tensor representing the true image shapes, as preprocessed images could be padded. features[fields.InputDataFields.original_image] is a [1, H', W', C] float32 tensor with the original image. labels: Dictionary of groundtruth tensors. labels[fields.InputDataFields.groundtruth_boxes] is a [1, num_boxes, 4] float32 tensor containing the corners of the groundtruth boxes. labels[fields.InputDataFields.groundtruth_classes] is a [num_boxes, num_classes] float32 one-hot tensor of classes. labels[fields.InputDataFields.groundtruth_area] is a [1, num_boxes] float32 tensor containing object areas. labels[fields.InputDataFields.groundtruth_is_crowd] is a [1, num_boxes] bool tensor indicating if the boxes enclose a crowd. labels[fields.InputDataFields.groundtruth_difficult] is a [1, num_boxes] int32 tensor indicating if the boxes represent difficult instances. -- Optional -- labels[fields.InputDataFields.groundtruth_instance_masks] is a [1, num_boxes, H, W] float32 tensor containing only binary values, which represent instance masks for objects. Raises: TypeError: if the `eval_config`, `eval_input_config` or `model_config` are not of the correct type. """ params = params or {} if not isinstance(eval_config, eval_pb2.EvalConfig): raise TypeError('For eval mode, the `eval_config` must be a ' 'train_pb2.EvalConfig.') if not isinstance(eval_input_config, input_reader_pb2.InputReader): raise TypeError('The `eval_input_config` must be a ' 'input_reader_pb2.InputReader.') if not isinstance(model_config, model_pb2.DetectionModel): raise TypeError('The `model_config` must be a ' 'model_pb2.DetectionModel.') def transform_and_pad_input_data_fn(tensor_dict): """Combines transform and pad operation.""" num_classes = config_util.get_number_of_classes(model_config) model = model_builder.build(model_config, is_training=False) image_resizer_config = config_util.get_image_resizer_config(model_config) image_resizer_fn = image_resizer_builder.build(image_resizer_config) transform_data_fn = functools.partial( transform_input_data, model_preprocess_fn=model.preprocess, image_resizer_fn=image_resizer_fn, num_classes=num_classes, data_augmentation_fn=None, retain_original_image=eval_config.retain_original_images) tensor_dict = pad_input_data_to_static_shapes( tensor_dict=transform_data_fn(tensor_dict), max_num_boxes=eval_input_config.max_number_of_boxes, num_classes=config_util.get_number_of_classes(model_config), spatial_image_shape=config_util.get_spatial_image_size( image_resizer_config)) return (_get_features_dict(tensor_dict), _get_labels_dict(tensor_dict)) dataset = INPUT_BUILDER_UTIL_MAP['dataset_build']( eval_input_config, batch_size=params['batch_size'] if params else eval_config.batch_size, transform_input_data_fn=transform_and_pad_input_data_fn, multi_gpu=False) return dataset return _eval_input_fn def create_predict_input_fn(model_config, predict_input_config): """Creates a predict `input` function for `Estimator`. Args: model_config: A model_pb2.DetectionModel. predict_input_config: An input_reader_pb2.InputReader. Returns: `input_fn` for `Estimator` in PREDICT mode. """ def _predict_input_fn(params=None): """Decodes serialized tf.Examples and returns `ServingInputReceiver`. Args: params: Parameter dictionary passed from the estimator. Returns: `ServingInputReceiver`. """ del params example = tf.placeholder(dtype=tf.string, shape=[], name='tf_example') num_classes = config_util.get_number_of_classes(model_config) model = model_builder.build(model_config, is_training=False) image_resizer_config = config_util.get_image_resizer_config(model_config) image_resizer_fn = image_resizer_builder.build(image_resizer_config) transform_fn = functools.partial( transform_input_data, model_preprocess_fn=model.preprocess, image_resizer_fn=image_resizer_fn, num_classes=num_classes, data_augmentation_fn=None) decoder = tf_example_decoder.TfExampleDecoder( load_instance_masks=False, num_additional_channels=predict_input_config.num_additional_channels) input_dict = transform_fn(decoder.decode(example)) images = tf.to_float(input_dict[fields.InputDataFields.image]) images = tf.expand_dims(images, axis=0) true_image_shape = tf.expand_dims( input_dict[fields.InputDataFields.true_image_shape], axis=0) return tf.estimator.export.ServingInputReceiver( features={ fields.InputDataFields.image: images, fields.InputDataFields.true_image_shape: true_image_shape}, receiver_tensors={SERVING_FED_EXAMPLE_KEY: example}) return _predict_input_fn
Tools/PyTorch/TimeSeriesPredictionPlatform/models/tft_pyt/scripts/autobench
autobench
ngc_favorita_HP_search
NGC: &NGC hostname: ngc instance: dgx1v.32g.8.norm job_name: "ml-model.tft favorita HP search" docker_image: nvcr.io/nvidian/swdl/jbaczek:tft_pyt datasets: /data: 78291 workspaces: /ws: VUMFFB3uSv25FDlkXg80Vw download_dir: /home/jbaczek/Downloads jobs: - steps: - EPOCHS=10 DATASET=favorita NGPU=8 DROPOUT=0.1 LR=5e-4 H_SIZE=240 N_HEADS=4 bash scripts/run_hp_search.sh backend: *NGC - steps: - EPOCHS=10 DATASET=favorita NGPU=8 DROPOUT=0.1 LR=1e-3 H_SIZE=240 N_HEADS=4 bash scripts/run_hp_search.sh backend: *NGC reports: filename: favorita_hp_search types: - xls
TensorFlow2/Recommendation/WideAndDeep/triton
triton
calculate_metrics
#!/usr/bin/env python3 # Copyright (c) 2021-2022, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. r""" Using `calculate_metrics.py` script, you can obtain model accuracy/error metrics using defined `MetricsCalculator` class. Data provided to `MetricsCalculator` are obtained from dump files stored in directory pointed by `--dump-dir` argument. Above files are prepared by `run_inference_on_fw.py` and `run_inference_on_triton.py` scripts. Output data is stored in csv file pointed by `--csv` argument. Example call: ```shell script python ./triton/calculate_metrics.py \ --dump-dir /results/dump_triton \ --csv /results/accuracy_results.csv \ --metrics metrics.py \ --metric-class-param1 value ``` """ import argparse import csv import logging import string from pathlib import Path # method from PEP-366 to support relative import in executed modules if __package__ is None: __package__ = Path(__file__).parent.name from .deployment_toolkit.args import ArgParserGenerator from .deployment_toolkit.core import BaseMetricsCalculator, load_from_file from .deployment_toolkit.dump import JsonDumpReader LOGGER = logging.getLogger("calculate_metrics") TOTAL_COLUMN_NAME = "_total_" def main(): logging.basicConfig(level=logging.INFO) parser = argparse.ArgumentParser(description="Run models with given dataloader", allow_abbrev=False) parser.add_argument("--metrics", help="Path to python module containing metrics calculator", required=True) parser.add_argument("--csv", help="Path to csv file", required=True) parser.add_argument("--dump-dir", help="Path to directory with dumped outputs (and labels)", required=True) args, *_ = parser.parse_known_args() MetricsCalculator = load_from_file(args.metrics, "metrics", "MetricsCalculator") ArgParserGenerator(MetricsCalculator).update_argparser(parser) args = parser.parse_args() LOGGER.info("args:") for key, value in vars(args).items(): LOGGER.info(f" {key} = {value}") MetricsCalculator = load_from_file(args.metrics, "metrics", "MetricsCalculator") metrics_calculator: BaseMetricsCalculator = ArgParserGenerator(MetricsCalculator).from_args(args) reader = JsonDumpReader(args.dump_dir) for ids, x, y_true, y_pred in reader.iterate_over(["ids", "inputs", "labels", "outputs"]): ids = list(ids["ids"]) if ids is not None else None metrics_calculator.update(ids=ids, x=x, y_pred=y_pred, y_real=y_true) metrics = metrics_calculator.metrics metric_names_with_space = [name for name in metrics if any([c in string.whitespace for c in name])] if metric_names_with_space: raise ValueError(f"Metric names shall have no spaces; Incorrect names: {', '.join(metric_names_with_space)}") csv_path = Path(args.csv) csv_path.parent.mkdir(parents=True, exist_ok=True) with csv_path.open("w") as csv_file: writer = csv.DictWriter(csv_file, fieldnames=list(metrics.keys())) writer.writeheader() writer.writerow(metrics) if __name__ == "__main__": main()
Tools/PyTorch/TimeSeriesPredictionPlatform/conf/model
model
dask_xgboost
# Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. _target_: models.tspp_xgboost.TSPPDaskXGBoost config: max_depth: 10 learning_rate: 0.2 subsample: 1.0 colsample_bytree: 0.8 tree_method: gpu_hist n_rounds: 400 objective: reg:squarederror cluster: world_size: 1 device_pool_frac: 0.9 protocol: tcp npartitions: 4 defaults: - _self_ - /trainer@_global_/trainer: xgbtrainer
TensorFlow2/LanguageModeling/BERT/official/utils/logs
logs
cloud_lib_test
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== """Tests for cloud_lib.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import unittest import mock import requests from official.utils.logs import cloud_lib class CloudLibTest(unittest.TestCase): @mock.patch("requests.get") def test_on_gcp(self, mock_requests_get): mock_response = mock.MagicMock() mock_requests_get.return_value = mock_response mock_response.status_code = 200 self.assertEqual(cloud_lib.on_gcp(), True) @mock.patch("requests.get") def test_not_on_gcp(self, mock_requests_get): mock_requests_get.side_effect = requests.exceptions.ConnectionError() self.assertEqual(cloud_lib.on_gcp(), False) if __name__ == "__main__": unittest.main()
PyTorch/SpeechSynthesis/Tacotron2/trtis_cpp/src/trt/util
util
engineCache
/* * Copyright (c) 2019-2020, NVIDIA CORPORATION. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * Neither the name of the NVIDIA CORPORATION nor the * names of its contributors may be used to endorse or promote products * derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL NVIDIA CORPORATION BE LIABLE FOR ANY * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "engineCache.h" #include "logging.h" #include "NvInferPlugin.h" #include <cassert> #include <fstream> #include <stdexcept> #include <string> using namespace nvinfer1; namespace tts { /****************************************************************************** * CONSTANTS ****************************************************************** *****************************************************************************/ namespace { constexpr const char* const SEP = "/"; constexpr size_t BUFFER_SIZE = 4 * 1024 * 1024; // 4MB } // namespace /****************************************************************************** * HELPER FUNCTIONS *********************************************************** *****************************************************************************/ namespace { template <typename T> void readNum(std::istream& in, T* num) { const size_t size = sizeof(*num); in.read(reinterpret_cast<char*>(num), size); const size_t numRead = static_cast<size_t>(in.gcount()); if (numRead != size) { throw std::runtime_error( "Failed to parse number: " + std::to_string(numRead) + " of " + std::to_string(size) + " bytes read."); } } std::ifstream openFileForRead(const std::string& filename) { std::ifstream fin(filename); if (!fin.good()) { throw std::runtime_error("Failed to open '" + filename + "'."); } fin.exceptions(std::ofstream::badbit); return fin; } TRTPtr<ICudaEngine> loadRawEngine(IRuntime& runtime, std::istream& in, const size_t size) { std::vector<char> data(size); in.read(data.data(), size); if (static_cast<size_t>(in.gcount()) != size) { throw std::runtime_error("Failed read entire engine from file."); } TRTPtr<ICudaEngine> engine( runtime.deserializeCudaEngine(data.data(), data.size(), nullptr)); if (!engine) { throw std::runtime_error("Failed to deserialize engine."); } return engine; } TRTPtr<ICudaEngine> loadEngine(IRuntime& runtime, std::istream& in) { uint64_t size; readNum(in, &size); return loadRawEngine(runtime, in, size); } } // namespace /****************************************************************************** * CONSTRUCTORS / DESTRUCTOR ************************************************** *****************************************************************************/ EngineCache::EngineCache(std::shared_ptr<ILogger> logger) : mLogger(logger) { std::lock_guard<std::mutex> lock(mMutex); if (!mRuntime) { mRuntime.reset(createInferRuntime(*mLogger)); } } /****************************************************************************** * PUBLIC METHODS ************************************************************* *****************************************************************************/ TRTPtr<ICudaEngine> EngineCache::load(const std::string& filename) { std::lock_guard<std::mutex> lock(mMutex); std::ifstream fin(filename, std::ifstream::binary); fin.exceptions(std::ofstream::badbit); fin.seekg(0, std::ifstream::end); const size_t size = fin.tellg(); fin.seekg(0, std::ifstream::beg); TRTPtr<ICudaEngine> engine = loadRawEngine(*mRuntime, fin, size); if (!engine) { throw std::runtime_error( "Failed to load engine from '" + filename + "'."); } return engine; } std::vector<TRTPtr<ICudaEngine>> EngineCache::loadComposite(const std::string& filename) { std::lock_guard<std::mutex> lock(mMutex); try { std::ifstream fin = openFileForRead(filename); fin.exceptions(std::ofstream::badbit); // load the number of engines uint32_t numEngines; readNum(fin, &numEngines); std::vector<TRTPtr<ICudaEngine>> engines; for (uint32_t i = 0; i < numEngines; ++i) { engines.emplace_back(loadEngine(*mRuntime, fin)); } assert(engines.size() == numEngines); return engines; } catch (const std::exception& e) { throw std::runtime_error("Failed to load multi-engine from '" + filename + "': " + e.what()); } } bool EngineCache::has(const std::string& filename) const { std::ifstream fin(filename); return fin.good(); } void EngineCache::save(const ICudaEngine& engine, const std::string& filename) { std::ofstream fout(filename, std::ofstream::trunc | std::ofstream::binary); if (!fout) { throw std::runtime_error( "Failed to open file '" + filename + "' for writing."); } try { fout.exceptions(std::ofstream::failbit); TRTPtr<IHostMemory> serialData(engine.serialize()); fout.write( static_cast<const char*>(serialData->data()), serialData->size()); } catch (const std::exception& e) { throw std::runtime_error( "Failed to save engine to '" + filename + "' due to: " + e.what()); } } void EngineCache::save( const std::vector<TRTPtr<ICudaEngine>>& engines, const std::string& filename) { try { std::ofstream fout( filename, std::ofstream::trunc | std::ofstream::binary); if (!fout) { throw std::runtime_error( "Failed to open file '" + filename + "' for writing."); } fout.exceptions(std::ofstream::failbit); const uint32_t num = static_cast<uint32_t>(engines.size()); fout.write(reinterpret_cast<const char*>(&num), sizeof(num)); for (const TRTPtr<ICudaEngine>& engine : engines) { if (!engine) { throw std::runtime_error("Cannot save null engine."); } TRTPtr<IHostMemory> serialData(engine->serialize()); const uint64_t size = serialData->size(); fout.write(reinterpret_cast<const char*>(&size), sizeof(size)); fout.write( static_cast<const char*>(serialData->data()), serialData->size()); } } catch (const std::exception& e) { throw std::runtime_error("Failed to save multi-engine to '" + filename + "': " + e.what()); } } TRTPtr<nvinfer1::IRuntime> EngineCache::mRuntime; std::mutex EngineCache::mMutex; } // namespace tts
PyTorch/Forecasting/TFT
TFT
modeling
# Copyright (c) 2021-2022, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import os import torch import torch.nn as nn import torch.nn.functional as F from torch import Tensor from torch.nn.parameter import UninitializedParameter from typing import Dict, Tuple, Optional, List MAKE_CONVERT_COMPATIBLE = os.environ.get("TFT_SCRIPTING", None) is not None from torch.nn import LayerNorm class MaybeLayerNorm(nn.Module): def __init__(self, output_size, hidden_size, eps): super().__init__() if output_size and output_size == 1: self.ln = nn.Identity() else: self.ln = LayerNorm(output_size if output_size else hidden_size, eps=eps) def forward(self, x): return self.ln(x) class GLU(nn.Module): def __init__(self, hidden_size, output_size): super().__init__() self.lin = nn.Linear(hidden_size, output_size * 2) def forward(self, x: Tensor) -> Tensor: x = self.lin(x) x = F.glu(x) return x class GRN(nn.Module): def __init__(self, input_size, hidden_size, output_size=None, context_hidden_size=None, dropout=0.0,): super().__init__() self.layer_norm = MaybeLayerNorm(output_size, hidden_size, eps=1e-3) self.lin_a = nn.Linear(input_size, hidden_size) if context_hidden_size is not None: self.lin_c = nn.Linear(context_hidden_size, hidden_size, bias=False) else: self.lin_c = nn.Identity() self.lin_i = nn.Linear(hidden_size, hidden_size) self.glu = GLU(hidden_size, output_size if output_size else hidden_size) self.dropout = nn.Dropout(dropout) self.out_proj = nn.Linear(input_size, output_size) if output_size else None def forward(self, a: Tensor, c: Optional[Tensor] = None): x = self.lin_a(a) if c is not None: x = x + self.lin_c(c).unsqueeze(1) x = F.elu(x) x = self.lin_i(x) x = self.dropout(x) x = self.glu(x) y = a if self.out_proj is None else self.out_proj(a) x = x + y return self.layer_norm(x) # @torch.jit.script #Currently broken with autocast def fused_pointwise_linear_v1(x, a, b): out = torch.mul(x.unsqueeze(-1), a) out = out + b return out @torch.jit.script def fused_pointwise_linear_v2(x, a, b): out = x.unsqueeze(3) * a out = out + b return out class TFTEmbedding(nn.Module): def __init__(self, config, initialize_cont_params=True): # initialize_cont_params=False prevents form initializing parameters inside this class # so they can be lazily initialized in LazyEmbedding module super().__init__() self.s_cat_inp_lens = config.static_categorical_inp_lens self.t_cat_k_inp_lens = config.temporal_known_categorical_inp_lens self.t_cat_o_inp_lens = config.temporal_observed_categorical_inp_lens self.s_cont_inp_size = config.static_continuous_inp_size self.t_cont_k_inp_size = config.temporal_known_continuous_inp_size self.t_cont_o_inp_size = config.temporal_observed_continuous_inp_size self.t_tgt_size = config.temporal_target_size self.hidden_size = config.hidden_size # There are 7 types of input: # 1. Static categorical # 2. Static continuous # 3. Temporal known a priori categorical # 4. Temporal known a priori continuous # 5. Temporal observed categorical # 6. Temporal observed continuous # 7. Temporal observed targets (time series obseved so far) self.s_cat_embed = nn.ModuleList([ nn.Embedding(n, self.hidden_size) for n in self.s_cat_inp_lens]) if self.s_cat_inp_lens else None self.t_cat_k_embed = nn.ModuleList([ nn.Embedding(n, self.hidden_size) for n in self.t_cat_k_inp_lens]) if self.t_cat_k_inp_lens else None self.t_cat_o_embed = nn.ModuleList([ nn.Embedding(n, self.hidden_size) for n in self.t_cat_o_inp_lens]) if self.t_cat_o_inp_lens else None if initialize_cont_params: self.s_cont_embedding_vectors = nn.Parameter(torch.Tensor(self.s_cont_inp_size, self.hidden_size)) if self.s_cont_inp_size else None self.t_cont_k_embedding_vectors = nn.Parameter(torch.Tensor(self.t_cont_k_inp_size, self.hidden_size)) if self.t_cont_k_inp_size else None self.t_cont_o_embedding_vectors = nn.Parameter(torch.Tensor(self.t_cont_o_inp_size, self.hidden_size)) if self.t_cont_o_inp_size else None self.t_tgt_embedding_vectors = nn.Parameter(torch.Tensor(self.t_tgt_size, self.hidden_size)) self.s_cont_embedding_bias = nn.Parameter(torch.zeros(self.s_cont_inp_size, self.hidden_size)) if self.s_cont_inp_size else None self.t_cont_k_embedding_bias = nn.Parameter(torch.zeros(self.t_cont_k_inp_size, self.hidden_size)) if self.t_cont_k_inp_size else None self.t_cont_o_embedding_bias = nn.Parameter(torch.zeros(self.t_cont_o_inp_size, self.hidden_size)) if self.t_cont_o_inp_size else None self.t_tgt_embedding_bias = nn.Parameter(torch.zeros(self.t_tgt_size, self.hidden_size)) self.reset_parameters() def reset_parameters(self): if self.s_cont_embedding_vectors is not None: torch.nn.init.xavier_normal_(self.s_cont_embedding_vectors) torch.nn.init.zeros_(self.s_cont_embedding_bias) if self.t_cont_k_embedding_vectors is not None: torch.nn.init.xavier_normal_(self.t_cont_k_embedding_vectors) torch.nn.init.zeros_(self.t_cont_k_embedding_bias) if self.t_cont_o_embedding_vectors is not None: torch.nn.init.xavier_normal_(self.t_cont_o_embedding_vectors) torch.nn.init.zeros_(self.t_cont_o_embedding_bias) if self.t_tgt_embedding_vectors is not None: torch.nn.init.xavier_normal_(self.t_tgt_embedding_vectors) torch.nn.init.zeros_(self.t_tgt_embedding_bias) if self.s_cat_embed is not None: for module in self.s_cat_embed: module.reset_parameters() if self.t_cat_k_embed is not None: for module in self.t_cat_k_embed: module.reset_parameters() if self.t_cat_o_embed is not None: for module in self.t_cat_o_embed: module.reset_parameters() def _apply_embedding(self, cat: Optional[Tensor], cont: Optional[Tensor], cat_emb: Optional[nn.ModuleList], cont_emb: Tensor, cont_bias: Tensor, ) -> Tuple[Optional[Tensor], Optional[Tensor]]: e_cat = torch.stack([embed(cat[...,i]) for i, embed in enumerate(cat_emb)], dim=-2) if cat is not None else None if cont is not None: #the line below is equivalent to following einsums #e_cont = torch.einsum('btf,fh->bthf', cont, cont_emb) #e_cont = torch.einsum('bf,fh->bhf', cont, cont_emb) if MAKE_CONVERT_COMPATIBLE: e_cont = torch.mul(cont.unsqueeze(-1), cont_emb) e_cont = e_cont + cont_bias else: e_cont = fused_pointwise_linear_v1(cont, cont_emb, cont_bias) else: e_cont = None if e_cat is not None and e_cont is not None: return torch.cat([e_cat, e_cont], dim=-2) elif e_cat is not None: return e_cat elif e_cont is not None: return e_cont else: return None def forward(self, x: Dict[str, Tensor]): # temporal/static categorical/continuous known/observed input s_cat_inp = x.get('s_cat', None) s_cont_inp = x.get('s_cont', None) t_cat_k_inp = x.get('k_cat', None) t_cont_k_inp = x.get('k_cont', None) t_cat_o_inp = x.get('o_cat', None) t_cont_o_inp = x.get('o_cont', None) t_tgt_obs = x['target'] # Has to be present # Static inputs are expected to be equal for all timesteps # For memory efficiency there is no assert statement s_cat_inp = s_cat_inp[:,0,:] if s_cat_inp is not None else None s_cont_inp = s_cont_inp[:,0,:] if s_cont_inp is not None else None s_inp = self._apply_embedding(s_cat_inp, s_cont_inp, self.s_cat_embed, self.s_cont_embedding_vectors, self.s_cont_embedding_bias) t_known_inp = self._apply_embedding(t_cat_k_inp, t_cont_k_inp, self.t_cat_k_embed, self.t_cont_k_embedding_vectors, self.t_cont_k_embedding_bias) t_observed_inp = self._apply_embedding(t_cat_o_inp, t_cont_o_inp, self.t_cat_o_embed, self.t_cont_o_embedding_vectors, self.t_cont_o_embedding_bias) # Temporal observed targets # t_observed_tgt = torch.einsum('btf,fh->btfh', t_tgt_obs, self.t_tgt_embedding_vectors) if MAKE_CONVERT_COMPATIBLE: t_observed_tgt = torch.matmul(t_tgt_obs.unsqueeze(3).unsqueeze(4), self.t_tgt_embedding_vectors.unsqueeze(1)).squeeze(3) t_observed_tgt = t_observed_tgt + self.t_tgt_embedding_bias else: t_observed_tgt = fused_pointwise_linear_v2(t_tgt_obs, self.t_tgt_embedding_vectors, self.t_tgt_embedding_bias) return s_inp, t_known_inp, t_observed_inp, t_observed_tgt class LazyEmbedding(nn.modules.lazy.LazyModuleMixin, TFTEmbedding): cls_to_become = TFTEmbedding def __init__(self, config): super().__init__(config, initialize_cont_params=False) if config.static_continuous_inp_size: self.s_cont_embedding_vectors = UninitializedParameter() self.s_cont_embedding_bias = UninitializedParameter() else: self.s_cont_embedding_vectors = None self.s_cont_embedding_bias = None if config.temporal_known_continuous_inp_size: self.t_cont_k_embedding_vectors = UninitializedParameter() self.t_cont_k_embedding_bias = UninitializedParameter() else: self.t_cont_k_embedding_vectors = None self.t_cont_k_embedding_bias = None if config.temporal_observed_continuous_inp_size: self.t_cont_o_embedding_vectors = UninitializedParameter() self.t_cont_o_embedding_bias = UninitializedParameter() else: self.t_cont_o_embedding_vectors = None self.t_cont_o_embedding_bias = None self.t_tgt_embedding_vectors = UninitializedParameter() self.t_tgt_embedding_bias = UninitializedParameter() def initialize_parameters(self, x): if self.has_uninitialized_params(): s_cont_inp = x.get('s_cont', None) t_cont_k_inp = x.get('k_cont', None) t_cont_o_inp = x.get('o_cont', None) t_tgt_obs = x['target'] # Has to be present if s_cont_inp is not None: self.s_cont_embedding_vectors.materialize((s_cont_inp.shape[-1], self.hidden_size)) self.s_cont_embedding_bias.materialize((s_cont_inp.shape[-1], self.hidden_size)) if t_cont_k_inp is not None: self.t_cont_k_embedding_vectors.materialize((t_cont_k_inp.shape[-1], self.hidden_size)) self.t_cont_k_embedding_bias.materialize((t_cont_k_inp.shape[-1], self.hidden_size)) if t_cont_o_inp is not None: self.t_cont_o_embedding_vectors.materialize((t_cont_o_inp.shape[-1], self.hidden_size)) self.t_cont_o_embedding_bias.materialize((t_cont_o_inp.shape[-1], self.hidden_size)) self.t_tgt_embedding_vectors.materialize((t_tgt_obs.shape[-1], self.hidden_size)) self.t_tgt_embedding_bias.materialize((t_tgt_obs.shape[-1], self.hidden_size)) self.reset_parameters() class VariableSelectionNetwork(nn.Module): def __init__(self, config, num_inputs): super().__init__() self.joint_grn = GRN(config.hidden_size*num_inputs, config.hidden_size, output_size=num_inputs, context_hidden_size=config.hidden_size) self.var_grns = nn.ModuleList([GRN(config.hidden_size, config.hidden_size, dropout=config.dropout) for _ in range(num_inputs)]) def forward(self, x: Tensor, context: Optional[Tensor] = None): Xi = torch.flatten(x, start_dim=-2) grn_outputs = self.joint_grn(Xi, c=context) sparse_weights = F.softmax(grn_outputs, dim=-1) transformed_embed_list = [m(x[...,i,:]) for i, m in enumerate(self.var_grns)] transformed_embed = torch.stack(transformed_embed_list, dim=-1) #the line below performs batched matrix vector multiplication #for temporal features it's bthf,btf->bth #for static features it's bhf,bf->bh variable_ctx = torch.matmul(transformed_embed, sparse_weights.unsqueeze(-1)).squeeze(-1) return variable_ctx, sparse_weights class StaticCovariateEncoder(nn.Module): def __init__(self, config): super().__init__() self.vsn = VariableSelectionNetwork(config, config.num_static_vars) self.context_grns = nn.ModuleList([GRN(config.hidden_size, config.hidden_size, dropout=config.dropout) for _ in range(4)]) def forward(self, x: Tensor) -> Tuple[Tensor, Tensor, Tensor, Tensor]: variable_ctx, sparse_weights = self.vsn(x) # Context vectors: # variable selection context # enrichment context # state_c context # state_h context cs, ce, ch, cc = [m(variable_ctx) for m in self.context_grns] return cs, ce, ch, cc class InterpretableMultiHeadAttention(nn.Module): def __init__(self, config): super().__init__() self.n_head = config.n_head assert config.hidden_size % config.n_head == 0 self.d_head = config.hidden_size // config.n_head self.qkv_linears = nn.Linear(config.hidden_size, (2 * self.n_head + 1) * self.d_head, bias=False) self.out_proj = nn.Linear(self.d_head, config.hidden_size, bias=False) self.attn_dropout = nn.Dropout(config.attn_dropout) self.out_dropout = nn.Dropout(config.dropout) self.scale = self.d_head**-0.5 self.register_buffer("_mask", torch.triu(torch.full((config.example_length, config.example_length), float('-inf')), 1).unsqueeze(0)) def forward(self, x: Tensor) -> Tuple[Tensor, Tensor]: bs, t, h_size = x.shape qkv = self.qkv_linears(x) q, k, v = qkv.split((self.n_head * self.d_head, self.n_head * self.d_head, self.d_head), dim=-1) q = q.view(bs, t, self.n_head, self.d_head) k = k.view(bs, t, self.n_head, self.d_head) v = v.view(bs, t, self.d_head) # attn_score = torch.einsum('bind,bjnd->bnij', q, k) attn_score = torch.matmul(q.permute((0, 2, 1, 3)), k.permute((0, 2, 3, 1))) attn_score.mul_(self.scale) attn_score = attn_score + self._mask attn_prob = F.softmax(attn_score, dim=3) attn_prob = self.attn_dropout(attn_prob) # attn_vec = torch.einsum('bnij,bjd->bnid', attn_prob, v) attn_vec = torch.matmul(attn_prob, v.unsqueeze(1)) m_attn_vec = torch.mean(attn_vec, dim=1) out = self.out_proj(m_attn_vec) out = self.out_dropout(out) return out, attn_prob class TFTBack(nn.Module): def __init__(self, config): super().__init__() self.encoder_length = config.encoder_length self.history_vsn = VariableSelectionNetwork(config, config.num_historic_vars) self.history_encoder = nn.LSTM(config.hidden_size, config.hidden_size, batch_first=True) self.future_vsn = VariableSelectionNetwork(config, config.num_future_vars) self.future_encoder = nn.LSTM(config.hidden_size, config.hidden_size, batch_first=True) self.input_gate = GLU(config.hidden_size, config.hidden_size) self.input_gate_ln = LayerNorm(config.hidden_size, eps=1e-3) self.enrichment_grn = GRN(config.hidden_size, config.hidden_size, context_hidden_size=config.hidden_size, dropout=config.dropout) self.attention = InterpretableMultiHeadAttention(config) self.attention_gate = GLU(config.hidden_size, config.hidden_size) self.attention_ln = LayerNorm(config.hidden_size, eps=1e-3) self.positionwise_grn = GRN(config.hidden_size, config.hidden_size, dropout=config.dropout) self.decoder_gate = GLU(config.hidden_size, config.hidden_size) self.decoder_ln = LayerNorm(config.hidden_size, eps=1e-3) self.quantile_proj = nn.Linear(config.hidden_size, len(config.quantiles)) def forward(self, historical_inputs, cs, ch, cc, ce, future_inputs): historical_features, _ = self.history_vsn(historical_inputs, cs) history, state = self.history_encoder(historical_features, (ch, cc)) future_features, _ = self.future_vsn(future_inputs, cs) future, _ = self.future_encoder(future_features, state) torch.cuda.synchronize() # skip connection input_embedding = torch.cat([historical_features, future_features], dim=1) temporal_features = torch.cat([history, future], dim=1) temporal_features = self.input_gate(temporal_features) temporal_features = temporal_features + input_embedding temporal_features = self.input_gate_ln(temporal_features) # Static enrichment enriched = self.enrichment_grn(temporal_features, c=ce) # Temporal self attention x, _ = self.attention(enriched) # Don't compute hictorical quantiles x = x[:, self.encoder_length:, :] temporal_features = temporal_features[:, self.encoder_length:, :] enriched = enriched[:, self.encoder_length:, :] x = self.attention_gate(x) x = x + enriched x = self.attention_ln(x) # Position-wise feed-forward x = self.positionwise_grn(x) # Final skip connection x = self.decoder_gate(x) x = x + temporal_features x = self.decoder_ln(x) out = self.quantile_proj(x) return out class TemporalFusionTransformer(nn.Module): """ Implementation of https://arxiv.org/abs/1912.09363 """ def __init__(self, config): super().__init__() if hasattr(config, 'model'): config = config.model self.encoder_length = config.encoder_length #this determines from how distant past we want to use data from self.embedding = LazyEmbedding(config) self.static_encoder = StaticCovariateEncoder(config) if MAKE_CONVERT_COMPATIBLE: self.TFTpart2 = TFTBack(config) else: self.TFTpart2 = torch.jit.script(TFTBack(config)) def forward(self, x: Dict[str, Tensor]) -> Tensor: s_inp, t_known_inp, t_observed_inp, t_observed_tgt = self.embedding(x) # Static context cs, ce, ch, cc = self.static_encoder(s_inp) ch, cc = ch.unsqueeze(0), cc.unsqueeze(0) #lstm initial states # Temporal input _historical_inputs = [t_known_inp[:,:self.encoder_length,:], t_observed_tgt[:,:self.encoder_length,:]] if t_observed_inp is not None: _historical_inputs.insert(0,t_observed_inp[:,:self.encoder_length,:]) historical_inputs = torch.cat(_historical_inputs, dim=-2) future_inputs = t_known_inp[:, self.encoder_length:] return self.TFTpart2(historical_inputs, cs, ch, cc, ce, future_inputs)
TensorFlow/LanguageModeling/Transformer-XL
Transformer-XL
README
# Transformer-XL For TensorFlow This repository provides a script and recipe to train the Transformer-XL model to achieve state-of-the-art accuracy and is tested and maintained by NVIDIA. Transformer-XL model for TensorFlow1 is no longer maintained and will soon become unavailable, please consider other PyTorch or TensorFlow2 models as a substitute for your requirements. ## Table Of Contents <!-- TOC GFM --> * [Model overview](#model-overview) * [Model architecture](#model-architecture) * [Default configuration](#default-configuration) * [Feature support matrix](#feature-support-matrix) * [Features](#features) * [Mixed precision training](#mixed-precision-training) * [Enabling mixed precision](#enabling-mixed-precision) * [Enabling TF32](#enabling-tf32) * [Setup](#setup) * [Requirements](#requirements) * [Quick Start Guide](#quick-start-guide) * [Advanced](#advanced) * [Scripts and sample code](#scripts-and-sample-code) * [Parameters](#parameters) * [Command-line options](#command-line-options) * [Getting the data](#getting-the-data) * [Dataset guidelines](#dataset-guidelines) * [Multi-dataset](#multi-dataset) * [Training process](#training-process) * [Inference process](#inference-process) * [Performance](#performance) * [Benchmarking](#benchmarking) * [Training performance benchmark](#training-performance-benchmark) * [Inference performance benchmark](#inference-performance-benchmark) * [Results](#results) * [Training accuracy results](#training-accuracy-results) * [Training accuracy: NVIDIA DGX A100 (8x A100 40GB)](#training-accuracy-nvidia-dgx-a100-8x-a100-40gb) * [Base model](#base-model) * [Training accuracy: NVIDIA DGX-1 (8x V100 16G)](#training-accuracy-nvidia-dgx-1-8x-v100-16gb) * [Base model](#base-model-1) * [Training accuracy: NVIDIA DGX-2 (16x V100 32G)](#training-accuracy-nvidia-dgx-2-16x-v100-32gb) * [Base model](#base-model-2) * [Training loss plot](#training-loss-plot) * [Training stability test](#training-stability-test) * [Base model](#base-model-4) * [Training performance results](#training-performance-results) * [Training performance: NVIDIA DGX A100 (8x A100 40GB)](#training-performance-nvidia-dgx-a100-8x-a100-40gb) * [Base model](#base-model-5) * [Training performance: NVIDIA DGX-1 (8x V100 16G)](#training-performance-nvidia-dgx-1-8x-v100-16bg) * [Base model](#base-model-6) * [Training performance: NVIDIA DGX-2 (16x V100 32G)](#training-performance-nvidia-dgx-2-16x-v100-32gb) * [Base model](#base-model-7) * [Inference performance results](#inference-performance-results) * [Inference performance: NVIDIA DGX A100 (1x A100 40GB)](#inference-performance-nvidia-dgx-a100-1x-a100-40gb) * [Base model](#base-model-8) * [Inference performance: NVIDIA DGX-1 (1x V100 16G)](#inference-performance-nvidia-dgx-1-1x-v100-16gb) * [Base model](#base-model-9) * [Inference performance: NVIDIA T4](#inference-performance-nvidia-t4) * [Base model](#base-model-10) * [Release notes](#release-notes) * [Changelog](#changelog) * [Known issues](#known-issues) <!-- /TOC --> ## Model overview This repository provides an implementation of the Transformer-XL model in [TensorFlow](https://www.tensorflow.org) from the paper [Transformer-XL: Attentive Language Models Beyond a Fixed-Length Context](https://arxiv.org/abs/1901.02860). Transformer-XL is a transformer-based language model with a segment-level recurrence and a novel relative positional encoding. Enhancements introduced in Transformer-XL help capture better long-term dependencies by attending to tokens from multiple previous segments. Our implementation is based on the [codebase](https://github.com/kimiyoung/transformer-xl) published by the authors of the Transformer-XL paper. Our implementation uses a modified model architecture. Our modifications were made to achieve better hardware utilization and to take advantage of Tensor Cores. Similar modifications were also proposed in an implementation available from [github.com/cybertronai/transformer-xl](https://github.com/cybertronai/transformer-xl). Refer to the [Model architecture](#model-architecture) section for more details. This model is trained with mixed precision using Tensor Cores on Volta, Turing, and the NVIDIA Ampere GPU architectures. Therefore, researchers can get results up to 1.5x faster than training without Tensor Cores, while experiencing the benefits of mixed precision training. This model is tested against each NGC monthly container release to ensure consistent accuracy and performance over time. ### Model architecture The Transformer-XL "base" model for WikiText-103 dataset available in this repository was modified to use the following hyperparameter values: |**Hyperparameter**|**Description**|**Original setting for the base model**|**Our modification to the base model**| |------------------|---------------|--------------------------------------:|--------------------------------------:| | `d_model` | hidden size | 410 | 512 | | `n_head` | number of attention heads | 10 | 8 | | `d_head` | size of each attention head | 41 | 64 | | `d_inner` | hidden size in fully-connected layers | 2100 | 2048 | | `tgt_len` | number of tokens to predict during training | 150 | 192 | | `mem_len` | number of tokens cached from previous iterations during training | 150 | 192 | Changes described above were made to align certain hyperparameters with powers of two, with this modification, the model is able to achieve better hardware utilization, and therefore higher training throughput. The following table lists the hyperparameters for the base Transformer-XL model for WikiText-103 dataset available in this repository. | **Hyperparameter** | **Description** | **Base model** | | ------------------ | ---------------------------------------------------------------- | -------------: | | `n_layer` | number of layers | 16 | | `d_model` | hidden size | 512 | | `n_head` | number of attention heads | 8 | | `d_head` | size of each attention head | 64 | | `d_inner` | inner hidden size in fully-connected layers | 2048 | | `dropout` | dropout | 0.1 | | `dropatt` | dropout after softmax in the attention | 0.0 | | `lr` | base learning rate | 0.01 | | `min_lr_ratio` | minimum ratio learning rate (for cosine decay) | 0.1 | | `max_step` | number of training steps | 40,000 | | `warmup_step` | number of learning rate warmup steps | 1,000 | | `batch_size` | training batch size | 256 | | `tgt_len` | number of tokens to predict during training | 192 | | `mem_len` | number of tokens cached from previous iterations during training | 192 | The Transformer-XL model addresses the limitations of vanilla transformer-based language models, which are only able to use relatively short context, bounded by the segment length. The Transformer-XL introduces a recurrence mechanism, which is able to use a cached hidden state from previous segments. During training, the context consists of a concatenation of the current segment's hidden state and cached states from previous iterations. Gradients are backpropagated only through the current segment, although the model is able to take advantage of the extra information stored in the cache and therefore is able to model long-term dependencies. An illustration of the recurrence mechanism taken from the [Transformer-XL paper](https://arxiv.org/abs/1901.02860) is shown below. ![model](tf/img/model.png) ### Default configuration The following features were implemented in this model: * general * single-node, Horovod multi-GPU training * training and inference with mixed precision using Tensor Cores * automatic mixed precision training (AMP) * model * 16-layer base Transformer-XL model with hidden size 512, 8 attention heads, each head with hidden size 64 * the model trained on [WikiText-103](https://blog.einstein.ai/the-wikitext-long-term-dependency-language-modeling-dataset/) dataset, using word-level vocabulary and adaptive softmax * embedding weights are tied with weights in the classifier * training * training with [LAMB](https://arxiv.org/abs/1904.00962) optimizer, the implementation of the optimizer uses [XLA](https://www.tensorflow.org/xla), which enables the fusion of elementwise operations and accelerates the training * support for training with a gradient accumulation * base model: * linear learning rate warmup for 1,000 iterations, followed by the cosine learning rate schedule, the initial learning rate is set to 0.0, and the final learning rate is set to 0.001 (min_lr_ratio * base_lr) * training for 40,000 steps, using a batch size of 256 * inference * support for single-GPU inference * each token is using the same size of the context from previous time steps. * base model: * target length is set to 64, length of memory is set to 640 * positional embeddings are clamped after 400 time steps ### Feature support matrix The following features are supported by this model: | **Feature** | **Transformer-XL** | |:------------|-------------------:| |[Automatic mixed precision (AMP)](https://nvidia.github.io/apex/amp.html) | Yes | |[Horovod Multi-GPU (NCCL)](https://github.com/horovod/horovod) | Yes | |[LAMB](https://arxiv.org/abs/1904.00962v3) | Yes | #### Features [TF-AMP](https://docs.nvidia.com/deeplearning/dgx/tensorflow-user-guide/index.html#tfamp) - a tool that enables Tensor Core-accelerated training. Refer to the [Enabling mixed precision](#enabling-mixed-precision) section for more details. [Horovod](https://github.com/horovod/horovod) - Horovod is a distributed training framework for TensorFlow, Keras, PyTorch, and MXNet. The goal of Horovod is to make distributed deep learning fast and easy to use. For more information about how to get started with Horovod, see the [Horovod: Official repository](https://github.com/horovod/horovod). [Multi-GPU training with Horovod](https://github.com/horovod/horovod/#usage) - our model uses Horovod to implement efficient multi-GPU training with NCCL. For details, see example sources in this repository or see the [TensorFlow tutorial](https://github.com/horovod/horovod/#usage). [LAMB](https://arxiv.org/abs/1904.00962v3) - stands for Layerwise Adaptive Moments Based optimizer, is a large batch optimization technique that helps accelerate training of deep neural networks using large minibatches. ### Mixed precision training Mixed precision is the combined use of different numerical precisions in a computational method. [Mixed precision](https://arxiv.org/abs/1710.03740) training offers significant computational speedup by performing operations in half-precision format while storing minimal information in single-precision to retain as much information as possible in critical parts of the network. Since the introduction of [Tensor Cores](https://developer.nvidia.com/tensor-cores) in Volta, and following with both the Turing and Ampere architectures, significant training speedups are experienced by switching to mixed precision -- up to 3x overall speedup on the most arithmetically intense model architectures. Using mixed precision training previously required two steps: 1. Porting the model to use the FP16 data type where appropriate. 2. Adding loss scaling to preserve small gradient values. This can now be achieved using Automatic Mixed Precision (AMP) for TensorFlow to enable the full [mixed precision methodology](https://docs.nvidia.com/deeplearning/sdk/mixed-precision-training/index.html#tensorflow) in your existing TensorFlow model code. AMP enables mixed precision training on Volta and Turing GPUs automatically. The TensorFlow framework code makes all necessary model changes internally. In TF-AMP, the computational graph is optimized to use as few casts as necessary and maximize the use of FP16, and the loss scaling is automatically applied inside of supported optimizers. AMP can be configured to work with the existing tf.contrib loss scaling manager by disabling the AMP scaling with a single environment variable to perform only the automatic mixed-precision optimization. It accomplishes this by automatically rewriting all computation graphs with the necessary operations to enable mixed precision training and automatic loss scaling. For information about: * How to train using mixed precision, see the [Mixed Precision Training](https://arxiv.org/abs/1710.03740) paper and [Training With Mixed Precision](https://docs.nvidia.com/deeplearning/sdk/mixed-precision-training/index.html) documentation. * Techniques used for mixed precision training, see the [Mixed-Precision Training of Deep Neural Networks](https://devblogs.nvidia.com/mixed-precision-training-deep-neural-networks/) blog. * How to access and enable AMP for TensorFlow, see [Using TF-AMP](https://docs.nvidia.com/deeplearning/dgx/tensorflow-user-guide/index.html#tfamp) from the TensorFlow User Guide. #### Enabling mixed precision Mixed precision is enabled in TensorFlow by using the Automatic Mixed Precision (TF-AMP) extension which casts variables to half-precision upon retrieval, while storing variables in single-precision format. Furthermore, to preserve small gradient magnitudes in backpropagation, a [loss scaling](https://docs.nvidia.com/deeplearning/sdk/mixed-precision-training/index.html#lossscaling) step must be included when applying gradients. In TensorFlow, loss scaling can be applied statically by using simple multiplication of loss by a constant value or automatically, by TF-AMP. Automatic mixed precision makes all the adjustments internally in TensorFlow, providing two benefits over manual operations. First, programmers need not modify network model code, reducing development and maintenance effort. Second, using AMP maintains forward and backward compatibility with all the APIs for defining and running TensorFlow models. To enable mixed precision, you can simply add the values to the environmental variables inside your training script: - Enable TF-AMP graph rewrite: ``` os.environ["TF_ENABLE_AUTO_MIXED_PRECISION_GRAPH_REWRITE"] = "1" ``` - Enable Automated Mixed Precision: ``` os.environ['TF_ENABLE_AUTO_MIXED_PRECISION'] = '1' ``` #### Enabling TF32 TensorFloat-32 (TF32) is the new math mode in [NVIDIA A100](https://www.nvidia.com/en-us/data-center/a100/) GPUs for handling the matrix math also called tensor operations. TF32 running on Tensor Cores in A100 GPUs can provide up to 10x speedups compared to single-precision floating-point math (FP32) on Volta GPUs. TF32 Tensor Cores can speed up networks using FP32, typically with no loss of accuracy. It is more robust than FP16 for models which require high dynamic range for weights or activations. For more information, refer to the [TensorFloat-32 in the A100 GPU Accelerates AI Training, HPC up to 20x](https://blogs.nvidia.com/blog/2020/05/14/tensorfloat-32-precision-format/) blog post. TF32 is supported in the NVIDIA Ampere GPU architecture and is enabled by default. ## Setup The following section lists the requirements that you need to meet in order to start training the Transformer-XL model. ### Requirements This repository contains `Dockerfile` which extends the TensorFlow NGC container and encapsulates some dependencies. Aside from these dependencies, ensure you have the following components: * [NVIDIA Docker](https://github.com/NVIDIA/nvidia-docker) * [TensorFlow 20.06-tf1-py3](https://ngc.nvidia.com/catalog/containers/nvidia:tensorflow) NGC container * GPU-based architecture: * [NVIDIA Volta](https://www.nvidia.com/en-us/data-center/volta-gpu-architecture/) * [NVIDIA Turing](https://www.nvidia.com/en-us/geforce/turing/) * [NVIDIA Ampere architecture](https://www.nvidia.com/en-us/data-center/nvidia-ampere-gpu-architecture/) For more information about how to get started with NGC containers, see the following sections from the NVIDIA GPU Cloud Documentation and the Deep Learning DGX Documentation: * [Getting Started Using NVIDIA GPU Cloud](https://docs.nvidia.com/ngc/ngc-getting-started-guide/index.html), * [Accessing And Pulling From The NGC Container Registry](https://docs.nvidia.com/deeplearning/dgx/user-guide/index.html#accessing_registry), * [Running TensorFlow](https://docs.nvidia.com/deeplearning/frameworks/tensorflow-release-notes/running.html#running) For those unable to use the TensorFlow NGC container, to set up the required environment or create your own container, see the versioned [NVIDIA Container Support Matrix](https://docs.nvidia.com/deeplearning/frameworks/support-matrix/index.html). ## Quick Start Guide To train your model using mixed precision with Tensor Cores or using FP32, perform the following steps using the default parameters of the Transformer-XL base model on the [WikiText-103](https://blog.einstein.ai/the-wikitext-long-term-dependency-language-modeling-dataset/) dataset. For the specifics concerning training and inference, see the [Advanced](#advanced) section. 1. Clone the repository. ``` git clone https://github.com/NVIDIA/DeepLearningExamples cd DeepLearningExamples/TensorFlow/LanguageModeling/Transformer-XL ``` 2. Download and preprocess the dataset. ``` bash getdata.sh ``` 3. Build the Transformer-XL TensorFlow NGC container. ``` bash tf/scripts/docker/build.sh ``` 4. Start an interactive session in the NGC container to run training/inference. ``` bash tf/scripts/docker/interactive.sh ``` 5. Create tfrecords before your first training/evaluation for a given batch size per GPU. Use same --batch_chunk and --training_batch_size flags as in the training. For training on DGX-A100 without gradient accumulation: ``` bash run_wt103_base.sh train_data ``` For training on DGX-1 with gradient accumulation in 2 steps: ``` bash run_wt103_base.sh train_data --batch_chunk 2 ``` For single GPU training with gradient accumulation in 16 steps: ``` bash run_wt103_base.sh train_data --batch_chunk 16 ``` For evaluation: ``` bash run_wt103_base.sh test_data ``` 6. Start training. To start TF32 training on 8 GPUs on DGX-A100, run: ``` bash run_wt103_base.sh train 8 ``` To start mixed precision training on 8 GPUs on DGX-1, run: ``` bash run_wt103_base.sh train 8 --amp --batch_chunk 2 ``` To start FP32 training on single GPU, run: ``` bash run_wt103_base.sh train 1 --batch_chunk 16 ``` To start mixed precision training on 16 GPUs on DGX-2, run: ``` bash run_wt103_base.sh train 16 --amp ``` To start FP32 training on 16 GPUs on DGX-2, run: ``` bash run_wt103_base.sh train 16 ``` For more information on the available options, and for an explanation of what happens at the end of training, refer to the [Training process](#training-process) section. 7. Start evaluation. To start mixed precision inference on the test set, run: ``` bash run_wt103_base.sh eval [--amp] ``` The `--amp` flag is optional, however, if it's set, then the script launches mixed precision inference with Tensor Cores. If the flag is not present, then the script launches FP32 inference. By default, the script is loading the checkpoint from `LM-TFM/model.ckpt`, which contains the model corresponding to the last checkpoint from the previous training run. The path to the checkpoint can be customized by setting the `--model_dir` flag. For more information on the available options, refer to the [Inference process](#inference-process) section. ## Advanced The following sections provide greater details of the dataset, running training and inference, and the training results. ### Scripts and sample code * `Dockerfile`: a container with the basic set of dependencies to run Transformer-XL In the `tf` directory, the most important files are: * `data_utils.py`: data loading utilities * `exp_utils.py`: utility functions for running training and benchmarking * `lamb.py`: implementation of [LAMB](https://arxiv.org/abs/1904.00962) optimizer * `main.py`: serves as the entry point to launch the training and inference * `model.py`: implementation of the Transformer-XL model * `vocabulary.py`: implementation of word-level vocabulary ### Parameters The complete list of available parameters for the `tf/main.py` script contains: ``` --batch_chunk: Number of accumulation steps. (default: '1') (an integer) --clamp_len: Clamp length (default: '-1') (an integer) --clip: Gradient clipping value. (default: '0.25') (a number) --corpus_info_path: Path to corpus-info.json file. (default: '') --d_embed: Dimension of the embeddings. (default: '512') (an integer) --d_head: Dimension of each attention head. (default: '64') (an integer) --d_inner: Dimension of inner hidden size in positionwise feed-forward. (default: '2048') (an integer) --d_model: Dimension of the model. (default: '512') (an integer) --data_dir: Path to tf-records directory. (default: '') --div_val: Divide the embedding size by this val for each bin (default: '1') (an integer) --[no]do_eval: Whether to run eval on the dev set. (default: 'false') --[no]do_train: Whether to run training. (default: 'true') --dropatt: Attention dropout rate. (default: '0.0') (a number) --dropout: Dropout rate. (default: '0.1') (a number) --eval_batch_size: Size of valid batch. (default: '16') (an integer) --eval_ckpt_path: Checkpoint path for do_test evaluation.If set, model_dir will be ignored.If unset, will use the latest ckpt in model_dir. --eval_split: Which data split to evaluate. (default: 'valid') --amp: Whether to enable AMP ops. (default: 'false') --init: <normal|uniform>: Initialization method. (default: 'normal') --init_range: Initialization std when init is uniform. (default: '0.1') (a number) --init_std: Initialization std when init is normal. (default: '0.02') (a number) --learning_rate: Maximum learning rate. (default: '0.01') (a number) --log_interval: Number of iterations per repeat loop. (default: '100') (an integer) --max_eval_batch: Set -1 to turn off. Only used in test mode. (default: '-1') (an integer) --mem_len: Number of steps to cache (default: '192') (an integer) --min_lr_ratio: Minimum ratio learning rate. (default: '0.1') (a number) --model_dir: Estimator model_dir. (default: 'LM-TFM') --n_head: Number of attention heads. (default: '8') (an integer) --n_layer: Number of layers. (default: '16') (an integer) --num_core_per_host: Number of cores per host (default: '8') (an integer) --percentiles: percentiles for latency confidence intervals (default: '90,95,99') (a comma separated list) --proj_init_std: Initialization std for embedding projection. (default: '0.01') (a number) --[no]proj_same_dim: Project the bin with the same dimension. (default: 'true') --[no]proj_share_all_but_first: True to share all but first projs, False not to share. (default: 'false') --record_info_dir: Path to local directory containing filenames.txt. (default: '') --[no]same_length: Same length attention (default: 'false') --save_steps: number of steps for model checkpointing. (default: '5000') (an integer) --tgt_len: Number of steps to predict (default: '192') (an integer) --[no]tie_weight: Tie embedding and softmax weight. (default: 'true') --train_batch_size: Size of train batch. (default: '256') (an integer) --train_steps: Total number of training steps. (default: '40000') (an integer) --[no]untie_r: untie r_w_bias and r_r_bias (default: 'false') --warmup_steps: Number of steps for linear lr warmup. (default: '1000') (an integer) ``` ### Command-line options To see the full list of available options and their descriptions, use the `--help` command-line option. For example: ``` python3 main.py --help ``` ### Getting the data The Transformer-XL model was trained on the [WikiText-103](https://blog.einstein.ai/the-wikitext-long-term-dependency-language-modeling-dataset/) dataset. The WikiText-103 dataset is a collection of over 100 million tokens extracted from the set of verified [Good](https://en.wikipedia.org/wiki/Wikipedia:Good_articles) and [Featured](https://en.wikipedia.org/wiki/Wikipedia:Featured_articles) articles on Wikipedia. This repository contains the `getdata.sh` download script which automatically downloads and extracts the training, validation and test datasets. By default, data is downloaded to the `data` directory. In order to test with other datasets, the script needs to be customized accordingly. #### Dataset guidelines The WikiText-103 dataset was already pre-tokenized with word-level tokens. The dataset features a large vocabulary of 267,735 tokens and retains the original case, punctuation and numbers. The `getdata.sh` script downloads the data, extracts the archive and renames the training, validation, and test set to `train.txt`, `valid.txt`, `test.txt` respectively. #### Multi-dataset Using other datasets requires changes in the `tf/data_utils.py` file: * the name of the new dataset should be added to the `dataset` flag * the support for the new dataset needs to be added to the `Corpus` class: names of files containing training, validation and test data, options for the tokenizer, dataset iterator and desired values of cutoffs for adaptive softmax The current codebase supports training with word-level vocabulary (automatically generated based on the provided dataset) Additionally, using other datasets may require changes in some hyperparameters (for example, batch size, learning rate, number of training steps, and the configuration of learning rate scheduler). ### Training process The default training configuration can be launched by running the `run_wt103_base.sh` script with the first argument set to `train`. By default, the training results are saved to `tf/LM-TFM` directory, and map to your container's `/workspace/transformer-x/tf/LM-TFM` directory; this can be customized by setting the `--model_dir` parameter. The training script launches a single-node data-parallel training with a fixed global batch size of 256, optionally with gradient accumulation to allow training on configurations with less than 16 GPUs. **Command-line** You can launch training of the Transformer-XL base model on the WikiText-103 dataset with the word-based vocabulary and adaptive softmax using `<#GPUs>` GPUs. For example: ``` bash run_wt103_base.sh train <#GPUs> [--amp] [--batch_chunk CHUNK] ``` The `--amp` flag is optional, however, if it's set, then the script launches mixed precision training with Tensor Cores; if the flag is not present, then the script launches FP32 training. The `--batch_chunk CHUNK` parameter controls gradient accumulation. With gradient accumulation, the batch size is split into `CHUNK` chunks of equal size, the training script executes the forward and backward pass using each chunk and then executes the optimizer using accumulated gradients. The `--train batch_size GBS` parameter can be used to change batch size. Equation below shows the relation between parameters: ``` global batch size (--train_batch_size) = <#GPU> * gradient accumulation steps (--batch_chunk) * local batch size ``` **Examples** You can launch mixed precision training of the Transformer-XL base model on the WikiText-103 dataset using 16 GPUs. For example: ``` bash run_wt103_base.sh train 16 --amp --batch_chunk 1 ``` The batch size per GPU is equal to the default global batch size of 256 divided by the product of the number of GPUs times the number of chunks. In this case, batch size per GPU is equal to `256 / (16 * 1) = 16`. You can launch FP32 training using 8 GPUs; the batch size per GPU is equal to 16 (`--batch_chunk` was set to `2` because a local batch size of 32 runs out of memory on a DGX-1 with Tesla V100 16G in FP32 training). For example: ``` bash run_wt103_base.sh train 8 --batch_chunk 2 ``` A summary of the training progress is printed after every 100 training iterations; this can be customized by setting the `--log_interval` parameter. The summary is printed in the following format: ``` step 1300 | lr 0.009998686 | loss 5.09 | pplx 162.70, bpc 7.3461, tok/s 138037 ``` which contains information about a current training step, current learning rate, current training loss, training [perplexity](https://en.wikipedia.org/wiki/Perplexity#Perplexity_per_word), bits per character and throughput in tokens per second. The script saves one checkpoint: `model.ckpt` which contains the last saved model. By default, model saving is executed every 5000 training steps, this can be customized by setting the `--save_steps` parameter. Evaluation (inference) benefits from longer attention sequences, therefore to reproduce perplexity values reported in the [Transformer-XL paper](https://arxiv.org/abs/1901.02860), it's necessary to run the final evaluation with a dedicated inference script. Refer to the [Inference process](#inference-process) section for more details. ### Inference process Inference can be run by launching the `run_wt103_base.sh` script with the first argument set to `eval`. Running inference requires a pre-trained model checkpoint. The script supports only single-GPU inference. **Command-line** You can launch inference of the Transformer-XL base model on the WikiText-103 dataset with the word-based vocabulary and adaptive softmax. For example: ``` bash run_wt103_base.sh eval --model_dir <PATH TO THE CHECKPOINT> [--amp] ``` The `--amp` flag is optional, however, if it's specified, then the script launches inference with Tensor Cores; if the flag is not present, then the script launches FP32 inference. **Examples** To launch mixed precision inference on a single GPU using a checkpoint loaded from `LM-TFM/model.ckpt*`, run: ``` bash run_wt103_base.sh eval --model_dir LM-TFM --amp ``` To launch FP32 inference on a single GPU using a checkpoint loaded from `LM-TFM/model.ckpt*`, run: ``` bash run_wt103_base.sh eval --model_dir LM-TFM ``` After the execution, the script prints a summary in the following format: ``` I0109 13:02:31.304439 139903273469760 main.py:440] Evaluating with: math fp16 INFO:tensorflow:| loss 3.15 | pplx 23.32, bpc 4.5432, tok/s 9946, ms/batch 102.84 ``` which contains information about loss, perplexity and execution performance on the test dataset. ## Performance The performance measurements in this document were conducted at the time of publication and may not reflect the performance achieved from NVIDIA’s latest software release. For the most up-to-date performance measurements, go to [NVIDIA Data Center Deep Learning Product Performance](https://developer.nvidia.com/deep-learning-performance-training-inference). ### Benchmarking The following section shows how to run benchmarks measuring the model performance in training and inference modes. #### Training performance benchmark To benchmark the training performance on a specific global batch size `<BS>`, with a specific number of GPUs `<#GPUs>` for a specific number of training iterations `<ITER>` run: For the base model: ``` bash run_wt103_base.sh train <#GPUs> --train_batch_size <BS> --train_steps <ITER> --log_interval 1 [--amp] [--batch_chunk CHUNK] ``` It's recommended to launch at least 1500 training steps to get a reliable estimate of training performance. For more information about the available options, refer to the [Training process](#training-process) section. The training script prints information in the following format: ``` (...) [1,0]<stderr>:INFO:tensorflow:step 99 | lr 0.000990000 | loss 9.22 | pplx 10069.60, bpc 13.2977, tok/s 136092 [1,0]<stderr>:I0109 12:18:41.333325 140403024426816 main.py:333] step 99 | lr 0.000990000 | loss 9.22 | pplx 10069.60, bpc 13.2977, tok/s 136092 [1,0]<stderr>:INFO:tensorflow:step 100 | lr 0.001000000 | loss 9.21 | pplx 9981.87, bpc 13.2851, tok/s 135309 [1,0]<stderr>:I0109 12:18:41.696926 140403024426816 main.py:333] step 100 | lr 0.001000000 | loss 9.21 | pplx 9981.87, bpc 13.2851, tok/s 135309 (...) [1,0]<stderr>:INFO:tensorflow:Training throughput: 135959 tok/s ``` The last two lines contain information on the average training throughput measured in tokens per second. #### Inference performance benchmark The inference performance and accuracy benchmarks require a checkpoint from a trained model. To benchmark the inference performance on a specific global batch size `<BS>`, run: ``` bash run_wt103_base.sh eval --model_dir <CHECKPOINT_DIR> --eval_batch_size <BS> [--amp] ``` The inference script prints information in the following format: ``` I0109 13:02:31.304439 139903273469760 main.py:440] Evaluating with: math fp16 INFO:tensorflow:| loss 3.15 | pplx 23.32, bpc 4.5432, tok/s 9946, ms/batch 102.84 ``` The output contains information on the achieved test loss and test perplexity, average inference throughput (measured in tokens per second), average inference latency (measured in milliseconds). ### Results The following sections provide details on how we achieved our performance and accuracy in training and inference. #### Training accuracy results ##### Training accuracy: NVIDIA DGX A100 (8x A100 40GB) ###### Base model Our results were obtained by running the `tf/run_wt103_base.sh` training script in the tensorflow:20.06-tf1-py3 NGC container on NVIDIA DGX A100 with8x A100 40GB GPUs. |**GPUs**|**Batch Size / GPU**|**Accuracy - TF32 (perplexity)**|**Accuracy - Mixed precision (perplexity)**|**Time to Train - TF32 (minutes)**|**Time to Train - Mixed precision (minutes)**|**Time to Train Speedup (TF32 to Mixed precision)**| |-------:|-------------------:|-------------------------------:|------------------------------------------:|---------------------------------:|--------------------------------------------:|--------------------------------------------------:| | 1 | 16 | 23.53 | 23.50 | 960 | 880 | 1.09 | | 8 | 16 | 23.45 | 23.48 | 150 | 142 | 1.06 | ##### Training accuracy: NVIDIA DGX-1 (8x V100 16GB) ###### Base model Our results were obtained by running the `tf/run_wt103_base.sh` training script in the tensorflow:20.06-tf1-py3 NGC container on NVIDIA DGX-1 with 8x V100 16G GPUs. |**GPUs**|**Batch Size / GPU**|**Accuracy - FP32 (perplexity)**|**Accuracy - Mixed precision (perplexity)**|**Time to Train - FP32 (minutes)**|**Time to Train - Mixed precision (minutes)**|**Time to Train Speedup (FP32 to Mixed precision)**| |-------:|-------------------:|-------------------------------:|------------------------------------------:|---------------------------------:|--------------------------------------------:|--------------------------------------------------:| | 1 | 16 | 23.64 | 23.58 | 2949 | 2021 | 1.46 | | 8 | 16 | 23.35 | 23.34 | 459 | 343 | 1.34 | ##### Training accuracy: NVIDIA DGX-2 (16x V100 32GB) ###### Base model Our results were obtained by running the `tf/run_wt103_base.sh` training script in the tensorflow:20.06-tf1-py3 NGC container on NVIDIA DGX-2 with 16x V100 32G GPUs. |**GPUs**|**Batch Size / GPU**|**Accuracy - FP32 (perplexity)**|**Accuracy - Mixed precision (perplexity)**|**Time to Train - FP32 (minutes)**|**Time to Train - Mixed precision (minutes)**|**Time to Train Speedup (FP32 to Mixed precision)**| |-------:|-------------------:|-------------------------------:|------------------------------------------:|---------------------------------:|--------------------------------------------:|--------------------------------------------------:| | 16 | 16 | 23.39 | 23.37 | 202 | 161 | 1.25 | | 8 | 32 | 23.33 | 23.40 | 330 | 227 | 1.46 | ##### Training loss plot ###### Base model ![TrainingLossBase](tf/img/training_loss_base.png) ##### Training stability test ###### Base model The Transformer-XL base model was trained for 40,000 training steps, starting from 20 different initial random seeds. The training was performed in the tensorflow:20.06-tf1-py3 NGC container on NVIDIA DGX-1 with 8x V100 16G GPUs. After training, the models were evaluated on the test dataset. The following table summarizes the final perplexity on the test set. |**Average perplexity**|**Standard deviation**|**Minimum**|**Maximum**|**Median**| |---------------------:|---------------------:|----------:|----------:|---------:| | 23.38 | 0.0879 | 23.24 | 23.58 | 23.39 | #### Training performance results ##### Training performance: NVIDIA DGX A100 (8x A100 40GB) Our results were obtained by running the `tf/run_wt103_base.sh` training script in the tensorflow:20.06-tf1-py3 NGC container on NVIDIA DGX A100 with 8x A100 40GB GPUs. Performance numbers (in tokens per second) were averaged over 2000 training iterations. |**GPUs**|**Batch Size / GPU**|**Throughput - TF32 (tok/s)**|**Throughput - Mixed precision (tok/s)**|**Throughput speedup (TF32 to Mixed precision)**|**Weak Scaling - TF32**|**Weak Scaling - Mixed precision**| |-------:|-------------------:|----------------------------:|---------------------------------------:|-----------------------------------------------:|----------------------:|---------------------------------:| | 1 | 16 | 25,127 | 26,130 | 1.040 | 1.000 | 1.000 | | 1 | 32 | 30,958 | 33,117 | 1.070 | 1.000 | 1.000 | | 1 | 64 | 34,244 | 36,455 | 1.065 | 1.000 | 1.000 | | 8 | 16 | 157,538 | 155,656 | 0.988 | 6.270 | 5.957 | | 8 | 32 | 224,474 | 227,502 | 1.013 | 7.251 | 6.870 | To achieve these same results, follow the steps in the [Quick Start Guide](#quick-start-guide). ##### Training performance: NVIDIA DGX-1 (8x V100 16GB) ###### Base model Our results were obtained by running the `tf/run_wt103_base.sh` training script in the tensorflow:20.06-tf1-py3 NGC container on NVIDIA DGX-1 with 8x V100 16G GPUs. Performance numbers (in tokens per second) were averaged over 2000 training iterations. |**GPUs**|**Batch Size / GPU**|**Throughput - FP32 (tok/s)**|**Throughput - Mixed precision (tok/s)**|**Throughput speedup (FP32 to Mixed precision)**|**Weak Scaling - FP32**|**Weak Scaling - Mixed precision**| |-------:|-------------------:|----------------------------:|---------------------------------------:|-----------------------------------------------:|----------------------:|---------------------------------:| | 1 | 16 | 9,104 | 13,004 | 1.428 | 1.000 | 1.000 | | 2 | 16 | 18,169 | 23,856 | 1.313 | 1.996 | 1.835 | | 4 | 16 | 38,876 | 50,310 | 1.294 | 4.270 | 3.869 | | 8 | 16 | 78,626 | 101,954 | 1.297 | 8.636 | 7.840 | To achieve these same results, follow the steps in the [Quick Start Guide](#quick-start-guide). ##### Training performance: NVIDIA DGX-2 (16x V100 32GB) ###### Base model Our results were obtained by running the `tf/run_wt103_base.sh` training script in the tensorflow:20.06-tf1-py3 NGC container on NVIDIA DGX-2 with 16x V100 32G GPUs. Performance numbers (in tokens per second) were averaged over 2000 training iterations. |**GPUs**|**Batch Size / GPU**|**Throughput - FP32 (tok/s)**|**Throughput - Mixed precision (tok/s)**|**Throughput speedup (FP32 to Mixed precision)**|**Weak Scaling - FP32**|**Weak Scaling - Mixed precision**| |-------:|-------------------:|----------------------------:|---------------------------------------:|-----------------------------------------------:|----------------------:|---------------------------------:| | 1 | 16 | 9,891 | 13,791 | 1.394 | 1.000 | 1.000 | | 2 | 16 | 21,550 | 28,306 | 1.314 | 2.179 | 2.052 | | 4 | 16 | 42,616 | 55,430 | 1.301 | 4.309 | 4.019 | | 8 | 16 | 83,932 | 107,999 | 1.287 | 8.486 | 7.831 | | 16 | 16 | 164,675 | 206,906 | 1.256 | 16.649 | 15.003 | To achieve these same results, follow the steps in the [Quick Start Guide](#quick-start-guide). #### Inference performance results ##### Inference performance: NVIDIA DGX A100 (1x A100 40GB) ###### Base model Our results were obtained by running the `tf/scripts/inference_benchmark.sh` inferencing benchmarking script in the tensorflow:20.06-tf1-py3 NGC container on NVIDIA DGX A100 (1x A100 40GB) GPU. The command to launch the inference performance benchmark is provided in the [Inference performance benchmark](#inference-performance-benchmark) section. **FP16** |**Batch size**|**Sequence length**|**Memory length**|**Throughput Avg (tok/s)**|**Latency Avg (ms)**|**Latency 90% (ms)**|**Latency 95% (ms)**|**Latency 99% (ms)**| |-------------:|------------------:|----------------:|-------------------------:|-------------------:|-------------------:|-------------------:|-------------------:| | 1 | 64 | 640 | 2592.8 | 24.71 | 25.72 | 26.12 | 26.68 | | 2 | 64 | 640 | 5060.4 | 25.32 | 26.58 | 26.93 | 27.71 | | 4 | 64 | 640 | 8910.2 | 28.73 | 29.74 | 30.06 | 30.58 | | 8 | 64 | 640 | 13844.1 | 36.96 | 37.62 | 37.80 | 38.34 | | 16 | 64 | 640 | 18313.1 | 55.92 | 56.46 | 56.69 | 57.39 | | 32 | 64 | 640 | 21854.7 | 93.63 | 94.37 | 94.74 | 94.92 | **TF32** |**Batch size**|**Sequence length**|**Memory length**|**Throughput Avg (tok/s)**|**Latency Avg (ms)**|**Latency 90% (ms)**|**Latency 95% (ms)**|**Latency 99% (ms)**| |-------------:|------------------:|----------------:|-------------------------:|-------------------:|-------------------:|-------------------:|-------------------:| | 1 | 64 | 640 | 2587.6 | 24.75 | 25.63 | 25.92 | 26.44 | | 2 | 64 | 640 | 5177.8 | 24.73 | 25.71 | 26.03 | 26.56 | | 4 | 64 | 640 | 9113.6 | 28.09 | 29.40 | 29.71 | 30.07 | | 8 | 64 | 640 | 13371.7 | 38.27 | 38.95 | 39.34 | 40.07 | | 16 | 64 | 640 | 16971.0 | 60.29 | 60.88 | 61.13 | 61.73 | | 32 | 64 | 640 | 19434.5 | 105.29 | 106.00 | 106.19 | 106.79 | To achieve these same results, follow the steps in the [Quick Start Guide](#quick-start-guide). ##### Inference performance: NVIDIA DGX-1 (1x V100 16GB) ###### Base model Our results were obtained by running the `tf/scripts/inference_benchmark.sh` inferencing benchmarking script in the tensorflow:20.06-tf1-py3 NGC container on NVIDIA DGX-1 with 1x V100 16G GPU. The command to launch the inference performance benchmark is provided in the [Inference performance benchmark](#inference-performance-benchmark) section. **FP16** |**Batch size**|**Sequence length**|**Memory length**|**Throughput Avg (tok/s)**|**Latency Avg (ms)**|**Latency 90% (ms)**|**Latency 95% (ms)**|**Latency 99% (ms)**| |-------------:|------------------:|----------------:|-------------------------:|-------------------:|-------------------:|-------------------:|-------------------:| | 1 | 64 | 640 | 1823.8 | 35.17 | 37.27 | 38.22 | 41.28 | | 2 | 64 | 640 | 3337.6 | 38.46 | 41.09 | 41.94 | 43.91 | | 4 | 64 | 640 | 5354.0 | 47.83 | 49.74 | 50.54 | 53.08 | | 8 | 64 | 640 | 7779.7 | 65.79 | 67.71 | 68.37 | 69.71 | | 16 | 64 | 640 | 9796.5 | 104.46 | 107.22 | 108.07 | 108.69 | | 32 | 64 | 640 | 11215.5 | 182.45 | 184.11 | 184.49 | 186.92 | **FP32** |**Batch size**|**Sequence length**|**Memory length**|**Throughput Avg (tok/s)**|**Latency Avg (ms)**|**Latency 90% (ms)**|**Latency 95% (ms)**|**Latency 99% (ms)**| |-------------:|------------------:|----------------:|-------------------------:|-------------------:|-------------------:|-------------------:|-------------------:| | 1 | 64 | 640 | 1912.7 | 33.56 | 35.98 | 36.84 | 38.96 | | 2 | 64 | 640 | 3497.0 | 36.66 | 39.07 | 39.85 | 41.28 | | 4 | 64 | 640 | 4732.9 | 54.10 | 56.32 | 57.10 | 58.14 | | 8 | 64 | 640 | 6303.7 | 81.19 | 83.32 | 84.02 | 88.12 | | 16 | 64 | 640 | 7676.3 | 133.29 | 134.84 | 135.33 | 136.70 | | 32 | 64 | 640 | 8555.6 | 239.15 | 240.02 | 240.20 | 240.48 | To achieve these same results, follow the steps in the [Quick Start Guide](#quick-start-guide). ##### Inference performance: NVIDIA T4 ###### Base model Our results were obtained by running the `tf/scripts/inference_benchmark.sh` inferencing benchmarking script in the tensorflow:20.06-tf1-py3 NGC container on NVIDIA T4. The command to launch the inference performance benchmark is provided in the [Inference performance benchmark](#inference-performance-benchmark) section. **FP16** |**Batch size**|**Sequence length**|**Memory length**|**Throughput Avg (tok/s)**|**Latency Avg (ms)**|**Latency 90% (ms)**|**Latency 95% (ms)**|**Latency 99% (ms)**| |-------------:|------------------:|----------------:|-------------------------:|-------------------:|-------------------:|-------------------:|-------------------:| | 1 | 64 | 640 | 1228.6 | 52.21 | 55.14 | 56.32 | 59.77 | | 2 | 64 | 640 | 2108.5 | 60.78 | 63.62 | 64.68 | 67.07 | | 4 | 64 | 640 | 3376.7 | 75.83 | 78.77 | 79.63 | 82.80 | | 8 | 64 | 640 | 4666.3 | 109.69 | 112.58 | 113.88 | 117.35 | | 16 | 64 | 640 | 5557.0 | 184.14 | 186.51 | 187.20 | 189.64 | | 32 | 64 | 640 | 6174.3 | 331.41 | 333.67 | 334.94 | 336.90 | **FP32** |**Batch size**|**Sequence length**|**Memory length**|**Throughput Avg (tok/s)**|**Latency Avg (ms)**|**Latency 90% (ms)**|**Latency 95% (ms)**|**Latency 99% (ms)**| |-------------:|------------------:|----------------:|-------------------------:|-------------------:|-------------------:|-------------------:|-------------------:| | 1 | 64 | 640 | 1029.7 | 62.28 | 65.82 | 66.93 | 70.22 | | 2 | 64 | 640 | 1667.7 | 76.81 | 79.80 | 80.71 | 84.35 | | 4 | 64 | 640 | 2302.3 | 111.13 | 113.75 | 114.85 | 118.57 | | 8 | 64 | 640 | 2756.9 | 185.58 | 188.16 | 189.38 | 192.68 | | 16 | 64 | 640 | 3188.8 | 320.86 | 324.24 | 325.63 | 327.76 | | 32 | 64 | 640 | 3439.1 | 594.96 | 599.13 | 599.89 | 602.59 | To achieve these same results, follow the steps in the [Quick Start Guide](#quick-start-guide). ## Release notes ### Changelog April 2023 * Ceased maintenance of this model in TensorFlow1 June 2020 * upgrade the TensorFlow container to 20.06 * update performance tables to include A100 results * April 2020 * Initial release * Support for FP32 and mixed precision training on NVIDIA DGX-1, NVIDIA DGX-2, and inference on NVIDIA Tesla V100 16G and NVIDIA T4 ### Known issues There are no known issues with this model.
Tools/DGLPyTorch/SyntheticGraphGeneration/syngen/generator/tabular
tabular
ctab
# Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. from typing import Dict, List, Tuple import numpy as np import pandas as pd import torch import torch.optim as optim import torch.utils.data from torch.nn import ( BatchNorm2d, BCELoss, Conv2d, ConvTranspose2d, CrossEntropyLoss, Dropout, LeakyReLU, Linear, Module, ReLU, Sequential, Sigmoid, SmoothL1Loss, ) from torch.nn import functional as F from torch.nn import init from torch.optim import Adam from sklearn import model_selection, preprocessing from syngen.generator.tabular.base_tabular_generator import BaseTabularGenerator from syngen.generator.tabular.data_transformer.ctab_data_transformer import ( CTABDataTransformer, ImageTransformer, ) from syngen.utils.types import ColumnType class CTABGenerator(BaseTabularGenerator): """ Adopted from: https://github.com/Team-TUD/CTAB-GAN Args: embedding_dim (int): Size of the random sample passed to the Generator. Defaults to 128. classifier_dim (tuple or list of ints): Size of the output samples for each one of the classifier Layers. A Linear Layer will be created for each one of the values provided. Defaults to (256, 256). l2scale (float): L2 regularization scaling. Defaults to 1e-5. batch_size (int): Number of data samples to process in each step. epochs (int): Number of training epochs. Defaults to 300. """ def __init__( self, classifier_dim: Tuple[int] = (256, 256, 256, 256), embedding_dim: int = 100, num_channels: int = 64, l2scale: float = 1e-5, batch_size: int = 500, epochs: int = 1, test_ratio: float = 0.1, **kwargs, ): self.embedding_dim = embedding_dim self.classifier_dim = classifier_dim self.num_channels = num_channels self.dside = None self.gside = None self.l2scale = l2scale self.batch_size = batch_size self.epochs = epochs self._device = torch.device( "cuda:0" if torch.cuda.is_available() else "cpu" ) self.test_ratio = test_ratio def column_check(self, data: pd.DataFrame, columns: list): data_cols = data.columns invalid_cols = [] for c in columns: if c not in data_cols: invalid_cols.append(c) return invalid_cols def set_device(self, device): self._device = device if self._generator is not None: self._generator.to(self._device) def fit( self, train_data: pd.DataFrame, categorical_columns: List[str] = [], log_columns: List[str] = [], integer_columns: List[str] = [], mixed_columns: Dict = {}, problem_type: Dict = {}, ): specified_cols = ( list(categorical_columns) + list(log_columns) + list(mixed_columns) + list(integer_columns) ) target_col = None target_index = None if problem_type: # - supports only single problem type target_col = list(problem_type.values())[0] specified_cols += [target_col] # - check for invalid columns invalid_cols = self.column_check(train_data, specified_cols) if len(invalid_cols): raise ValueError(f"invalid columns: {invalid_cols}") if target_col is not None: target_index = train_data.columns.get_loc(target_col) self.data_prep = DataPreprocessing( categorical_columns=categorical_columns, log_columns=log_columns, mixed_columns=mixed_columns, integer_columns=integer_columns, test_ratio=self.test_ratio, target_col=target_col, ) train_data = self.data_prep.transform(train_data) categorical_columns = self.data_prep.column_types[ ColumnType.CATEGORICAL ] mixed_columns = self.data_prep.column_types[ColumnType.MIXED] self.transformer = CTABDataTransformer( categorical_columns=categorical_columns, mixed_dict=mixed_columns ) self.transformer.fit(train_data) train_data = self.transformer.transform(train_data.values) data_sampler = Sampler(train_data, self.transformer.output_info) data_dim = self.transformer.output_dim self.cond_generator = Cond(train_data, self.transformer.output_info) sides = [4, 8, 16, 24, 32, 64, 128] col_size_d = data_dim + self.cond_generator.n_opt for i in sides: if i * i >= col_size_d: self.dside = i break sides = [4, 8, 16, 24, 32, 64, 128] col_size_g = data_dim for i in sides: if i * i >= col_size_g: self.gside = i break layers_G = determine_layers_gen( self.gside, self.embedding_dim + self.cond_generator.n_opt, self.num_channels, ) layers_D = determine_layers_disc(self.dside, self.num_channels) self._generator = Generator(self.gside, layers_G).to(self._device) discriminator = Discriminator(self.dside, layers_D).to(self._device) optimizer_params = dict( lr=2e-4, betas=(0.5, 0.9), eps=1e-3, weight_decay=self.l2scale ) optimizerG = Adam(self._generator.parameters(), **optimizer_params) optimizerD = Adam(discriminator.parameters(), **optimizer_params) st_ed = None classifier = None optimizerC = None if target_index is not None: st_ed = get_st_ed(target_index, self.transformer.output_info) classifier = Classifier(data_dim, self.classifier_dim, st_ed).to( self._device ) optimizerC = optim.Adam( classifier.parameters(), **optimizer_params ) self._generator.apply(weights_init) discriminator.apply(weights_init) self.Gtransformer = ImageTransformer(self.gside) self.Dtransformer = ImageTransformer(self.dside) steps_per_epoch = max(1, len(train_data) // self.batch_size) for i in range(self.epochs): for _ in range(steps_per_epoch): noisez = torch.randn( self.batch_size, self.embedding_dim, device=self._device ) condvec = self.cond_generator.sample_train(self.batch_size) c, m, col, opt = condvec c = torch.from_numpy(c).to(self._device) m = torch.from_numpy(m).to(self._device) noisez = torch.cat([noisez, c], dim=1) noisez = noisez.view( self.batch_size, self.embedding_dim + self.cond_generator.n_opt, 1, 1, ) perm = np.arange(self.batch_size) np.random.shuffle(perm) real = data_sampler.sample( self.batch_size, col[perm], opt[perm] ) c_perm = c[perm] real = torch.from_numpy(real.astype("float32")).to( self._device ) fake = self._generator(noisez) faket = self.Gtransformer.inverse_transform(fake) fakeact = apply_activate(faket, self.transformer.output_info) fake_cat = torch.cat([fakeact, c], dim=1) real_cat = torch.cat([real, c_perm], dim=1) real_cat_d = self.Dtransformer.transform(real_cat) fake_cat_d = self.Dtransformer.transform(fake_cat) optimizerD.zero_grad() y_real, _ = discriminator(real_cat_d) y_fake, _ = discriminator(fake_cat_d) loss_d = -(torch.log(y_real + 1e-4).mean()) - ( torch.log(1.0 - y_fake + 1e-4).mean() ) loss_d.backward() optimizerD.step() noisez = torch.randn( self.batch_size, self.embedding_dim, device=self._device ) condvec = self.cond_generator.sample_train(self.batch_size) c, m, col, opt = condvec c = torch.from_numpy(c).to(self._device) m = torch.from_numpy(m).to(self._device) noisez = torch.cat([noisez, c], dim=1) noisez = noisez.view( self.batch_size, self.embedding_dim + self.cond_generator.n_opt, 1, 1, ) optimizerG.zero_grad() fake = self._generator(noisez) faket = self.Gtransformer.inverse_transform(fake) fakeact = apply_activate(faket, self.transformer.output_info) fake_cat = torch.cat([fakeact, c], dim=1) fake_cat = self.Dtransformer.transform(fake_cat) y_fake, info_fake = discriminator(fake_cat) cross_entropy = cond_loss( faket, self.transformer.output_info, c, m ) _, info_real = discriminator(real_cat_d) g = -(torch.log(y_fake + 1e-4).mean()) + cross_entropy g.backward(retain_graph=True) loss_mean = torch.norm( torch.mean(info_fake.view(self.batch_size, -1), dim=0) - torch.mean(info_real.view(self.batch_size, -1), dim=0), 1, ) loss_std = torch.norm( torch.std(info_fake.view(self.batch_size, -1), dim=0) - torch.std(info_real.view(self.batch_size, -1), dim=0), 1, ) loss_info = loss_mean + loss_std loss_info.backward() optimizerG.step() if problem_type: fake = self._generator(noisez) faket = self.Gtransformer.inverse_transform(fake) fakeact = apply_activate( faket, self.transformer.output_info ) real_pre, real_label = classifier(real) fake_pre, fake_label = classifier(fakeact) c_loss = CrossEntropyLoss() if (st_ed[1] - st_ed[0]) == 1: c_loss = SmoothL1Loss() real_label = real_label.type_as(real_pre) fake_label = fake_label.type_as(fake_pre) real_label = torch.reshape(real_label, real_pre.size()) fake_label = torch.reshape(fake_label, fake_pre.size()) elif (st_ed[1] - st_ed[0]) == 2: c_loss = BCELoss() real_label = real_label.type_as(real_pre) fake_label = fake_label.type_as(fake_pre) loss_cc = c_loss(real_pre, real_label) loss_cg = c_loss(fake_pre, fake_label) optimizerG.zero_grad() loss_cg.backward() optimizerG.step() optimizerC.zero_grad() loss_cc.backward() optimizerC.step() def sample(self, n, **kwargs): assert hasattr(self, "_generator"), "`fit` function must be called prior to `sample`" self._generator.eval() output_info = self.transformer.output_info steps = n // self.batch_size + 1 data = [] for i in range(steps): noisez = torch.randn( self.batch_size, self.embedding_dim, device=self._device ) condvec = self.cond_generator.sample(self.batch_size) c = condvec c = torch.from_numpy(c).to(self._device) noisez = torch.cat([noisez, c], dim=1) noisez = noisez.view( self.batch_size, self.embedding_dim + self.cond_generator.n_opt, 1, 1, ) fake = self._generator(noisez) faket = self.Gtransformer.inverse_transform(fake) fakeact = apply_activate(faket, output_info) data.append(fakeact.detach().cpu().numpy()) data = np.concatenate(data, axis=0) result = self.transformer.inverse_transform(data) output = self.data_prep.inverse_prep(result) return output.iloc[:n] class Classifier(Module): def __init__(self, input_dim, dis_dims, st_ed): super(Classifier, self).__init__() dim = input_dim - (st_ed[1] - st_ed[0]) seq = [] self.str_end = st_ed for item in list(dis_dims): seq += [Linear(dim, item), LeakyReLU(0.2), Dropout(0.5)] dim = item if (st_ed[1] - st_ed[0]) == 1: seq += [Linear(dim, 1)] elif (st_ed[1] - st_ed[0]) == 2: seq += [Linear(dim, 1), Sigmoid()] else: seq += [Linear(dim, (st_ed[1] - st_ed[0]))] self.seq = Sequential(*seq) def forward(self, input): label = None if (self.str_end[1] - self.str_end[0]) == 1: label = input[:, self.str_end[0] : self.str_end[1]] else: label = torch.argmax( input[:, self.str_end[0] : self.str_end[1]], axis=-1 ) new_imp = torch.cat( (input[:, : self.str_end[0]], input[:, self.str_end[1] :]), 1 ) if ((self.str_end[1] - self.str_end[0]) == 2) | ( (self.str_end[1] - self.str_end[0]) == 1 ): return self.seq(new_imp).view(-1), label else: return self.seq(new_imp), label def apply_activate(data, output_info): data_t = [] st = 0 for item in output_info: if item[1] == "tanh": ed = st + item[0] data_t.append(torch.tanh(data[:, st:ed])) st = ed elif item[1] == "softmax": ed = st + item[0] data_t.append(F.gumbel_softmax(data[:, st:ed], tau=0.2)) st = ed return torch.cat(data_t, dim=1) def get_st_ed(target_col_index, output_info): st = 0 c = 0 tc = 0 for item in output_info: if c == target_col_index: break if item[1] == "tanh": st += item[0] elif item[1] == "softmax": st += item[0] c += 1 tc += 1 ed = st + output_info[tc][0] return (st, ed) def random_choice_prob_index_sampling(probs, col_idx): option_list = [] for i in col_idx: pp = probs[i] option_list.append(np.random.choice(np.arange(len(probs[i])), p=pp)) return np.array(option_list).reshape(col_idx.shape) def random_choice_prob_index(a, axis=1): r = np.expand_dims(np.random.rand(a.shape[1 - axis]), axis=axis) return (a.cumsum(axis=axis) > r).argmax(axis=axis) def maximum_interval(output_info): max_interval = 0 for item in output_info: max_interval = max(max_interval, item[0]) return max_interval class Cond(object): def __init__(self, data, output_info): self.model = [] st = 0 counter = 0 for item in output_info: if item[1] == "tanh": st += item[0] elif item[1] == "softmax": ed = st + item[0] counter += 1 self.model.append(np.argmax(data[:, st:ed], axis=-1)) st = ed self.interval = [] self.n_col = 0 self.n_opt = 0 st = 0 self.p = np.zeros((counter, maximum_interval(output_info))) self.p_sampling = [] for item in output_info: if item[1] == "tanh": st += item[0] elif item[1] == "softmax": ed = st + item[0] tmp = np.sum(data[:, st:ed], axis=0) tmp_sampling = np.sum(data[:, st:ed], axis=0) tmp = np.log(tmp + 1) tmp = tmp / np.sum(tmp) tmp_sampling = tmp_sampling / np.sum(tmp_sampling) self.p_sampling.append(tmp_sampling) self.p[self.n_col, : item[0]] = tmp self.interval.append((self.n_opt, item[0])) self.n_opt += item[0] self.n_col += 1 st = ed self.interval = np.asarray(self.interval) def sample_train(self, batch): if self.n_col == 0: return None idx = np.random.choice(np.arange(self.n_col), batch) vec = np.zeros((batch, self.n_opt), dtype="float32") mask = np.zeros((batch, self.n_col), dtype="float32") mask[np.arange(batch), idx] = 1 opt1prime = random_choice_prob_index(self.p[idx]) for i in np.arange(batch): vec[i, self.interval[idx[i], 0] + opt1prime[i]] = 1 return vec, mask, idx, opt1prime def sample(self, batch): if self.n_col == 0: return None idx = np.random.choice(np.arange(self.n_col), batch) vec = np.zeros((batch, self.n_opt), dtype="float32") opt1prime = random_choice_prob_index_sampling(self.p_sampling, idx) for i in np.arange(batch): vec[i, self.interval[idx[i], 0] + opt1prime[i]] = 1 return vec def cond_loss(data, output_info, c, m): loss = [] st = 0 st_c = 0 for item in output_info: if item[1] == "tanh": st += item[0] elif item[1] == "softmax": ed = st + item[0] ed_c = st_c + item[0] tmp = F.cross_entropy( data[:, st:ed], torch.argmax(c[:, st_c:ed_c], dim=1), reduction="none", ) loss.append(tmp) st = ed st_c = ed_c loss = torch.stack(loss, dim=1) return (loss * m).sum() / data.size()[0] class Sampler(object): def __init__(self, data, output_info): super(Sampler, self).__init__() self.data = data self.model = [] self.n = len(data) st = 0 for item in output_info: if item[1] == "tanh": st += item[0] elif item[1] == "softmax": ed = st + item[0] tmp = [] for j in range(item[0]): tmp.append(np.nonzero(data[:, st + j])[0]) self.model.append(tmp) st = ed def sample(self, n, col, opt): if col is None: idx = np.random.choice(np.arange(self.n), n) return self.data[idx] idx = [] for c, o in zip(col, opt): idx.append(np.random.choice(self.model[c][o])) return self.data[idx] class Discriminator(Module): def __init__(self, side, layers): super(Discriminator, self).__init__() self.side = side info = len(layers) - 2 self.seq = Sequential(*layers) self.seq_info = Sequential(*layers[:info]) def forward(self, input): return (self.seq(input)), self.seq_info(input) class Generator(Module): def __init__(self, side, layers): super(Generator, self).__init__() self.side = side self.seq = Sequential(*layers) def forward(self, input_): return self.seq(input_) def determine_layers_disc(side, num_channels): layer_dims = [(1, side), (num_channels, side // 2)] while layer_dims[-1][1] > 3 and len(layer_dims) < 4: layer_dims.append((layer_dims[-1][0] * 2, layer_dims[-1][1] // 2)) layers_D = [] for prev, curr in zip(layer_dims, layer_dims[1:]): layers_D += [ Conv2d(prev[0], curr[0], 4, 2, 1, bias=False), BatchNorm2d(curr[0]), LeakyReLU(0.2, inplace=True), ] print() layers_D += [ Conv2d(layer_dims[-1][0], 1, layer_dims[-1][1], 1, 0), Sigmoid(), ] return layers_D def determine_layers_gen(side, embedding_dim, num_channels): layer_dims = [(1, side), (num_channels, side // 2)] while layer_dims[-1][1] > 3 and len(layer_dims) < 4: layer_dims.append((layer_dims[-1][0] * 2, layer_dims[-1][1] // 2)) layers_G = [ ConvTranspose2d( embedding_dim, layer_dims[-1][0], layer_dims[-1][1], 1, 0, output_padding=0, bias=False, ) ] for prev, curr in zip(reversed(layer_dims), reversed(layer_dims[:-1])): layers_G += [ BatchNorm2d(prev[0]), ReLU(True), ConvTranspose2d( prev[0], curr[0], 4, 2, 1, output_padding=0, bias=True ), ] return layers_G def weights_init(m): classname = m.__class__.__name__ if classname.find("Conv") != -1: init.normal_(m.weight.data, 0.0, 0.02) elif classname.find("BatchNorm") != -1: init.normal_(m.weight.data, 1.0, 0.02) init.constant_(m.bias.data, 0) class DataPreprocessing(object): def __init__( self, categorical_columns: list, log_columns: list, mixed_columns: dict, integer_columns: list, test_ratio: float, target_col: str = None, ): self.categorical_columns = categorical_columns self.log_columns = log_columns self.mixed_columns = mixed_columns self.integer_columns = integer_columns self.column_types = dict() self.column_types[ColumnType.CATEGORICAL] = [] self.column_types[ColumnType.MIXED] = {} self.lower_bounds = {} self.label_encoder_list = [] self.CONSTANT_INT = -9999999 if target_col is not None: self.target_col = target_col self.test_ratio = test_ratio super().__init__() def transform(self, raw_df: pd.DataFrame): if hasattr(self, "target_col"): y_real = raw_df[self.target_col] X_real = raw_df.drop(columns=[self.target_col]) ( X_train_real, _, y_train_real, _, ) = model_selection.train_test_split( X_real, y_real, test_size=self.test_ratio, stratify=y_real, random_state=42, ) X_train_real.loc[:, self.target_col] = y_train_real else: X_train_real = raw_df self.df = X_train_real self.df = self.df.replace(r" ", np.nan) self.df = self.df.fillna("empty") all_columns = set(self.df.columns) irrelevant_missing_columns = set(self.categorical_columns) relevant_missing_columns = list( all_columns - irrelevant_missing_columns ) for i in relevant_missing_columns: if i in self.log_columns: if "empty" in list(self.df[i].values): self.df[i] = self.df[i].apply( lambda x: self.CONSTANT_INT if x == "empty" else x ) self.mixed_columns[i] = [self.CONSTANT_INT] elif i in list(self.mixed_columns.keys()): if "empty" in list(self.df[i].values): self.df[i] = self.df[i].apply( lambda x: self.CONSTANT_INT if x == "empty" else x ) self.mixed_columns[i].append(self.CONSTANT_INT) else: if "empty" in list(self.df[i].values): self.df[i] = self.df[i].apply( lambda x: self.CONSTANT_INT if x == "empty" else x ) self.mixed_columns[i] = [self.CONSTANT_INT] if self.log_columns: for log_column in self.log_columns: valid_indices = [] for idx, val in enumerate(self.df[log_column].values): if val != self.CONSTANT_INT: valid_indices.append(idx) eps = 1 lower = np.min(self.df[log_column].iloc[valid_indices].values) self.lower_bounds[log_column] = lower if lower > 0: self.df[log_column] = self.df[log_column].apply( lambda x: np.log(x) if x != self.CONSTANT_INT else self.CONSTANT_INT ) elif lower == 0: self.df[log_column] = self.df[log_column].apply( lambda x: np.log(x + eps) if x != self.CONSTANT_INT else self.CONSTANT_INT ) else: self.df[log_column] = self.df[log_column].apply( lambda x: np.log(x - lower + eps) if x != self.CONSTANT_INT else self.CONSTANT_INT ) for column_index, column in enumerate(self.df.columns): if column in self.categorical_columns: label_encoder = preprocessing.LabelEncoder() self.df[column] = self.df[column].astype(str) label_encoder.fit(self.df[column]) current_label_encoder = dict() current_label_encoder["column"] = column current_label_encoder["label_encoder"] = label_encoder transformed_column = label_encoder.transform(self.df[column]) self.df[column] = transformed_column self.label_encoder_list.append(current_label_encoder) self.column_types[ColumnType.CATEGORICAL].append(column_index) elif column in self.mixed_columns: self.column_types[ColumnType.MIXED][ column_index ] = self.mixed_columns[column] return self.df def inverse_prep(self, data, eps=1): df_sample = pd.DataFrame(data, columns=self.df.columns) for i in range(len(self.label_encoder_list)): le = self.label_encoder_list[i]["label_encoder"] df_sample[self.label_encoder_list[i]["column"]] = df_sample[ self.label_encoder_list[i]["column"] ].astype(int) df_sample[ self.label_encoder_list[i]["column"] ] = le.inverse_transform( df_sample[self.label_encoder_list[i]["column"]] ) if self.log_columns: for i in df_sample: if i in self.log_columns: lower_bound = self.lower_bounds[i] if lower_bound > 0: df_sample[i].apply(lambda x: np.exp(x)) elif lower_bound == 0: df_sample[i] = df_sample[i].apply( lambda x: np.ceil(np.exp(x) - eps) if (np.exp(x) - eps) < 0 else (np.exp(x) - eps) ) else: df_sample[i] = df_sample[i].apply( lambda x: np.exp(x) - eps + lower_bound ) if self.integer_columns: for column in self.integer_columns: df_sample[column] = np.round(df_sample[column].values) df_sample[column] = df_sample[column].astype(int) df_sample.replace(self.CONSTANT_INT, np.nan, inplace=True) df_sample.replace("empty", np.nan, inplace=True) return df_sample
TensorFlow/Detection/SSD/models/research/slim/datasets
datasets
download_and_convert_cifar10
# Copyright 2016 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== r"""Downloads and converts cifar10 data to TFRecords of TF-Example protos. This module downloads the cifar10 data, uncompresses it, reads the files that make up the cifar10 data and creates two TFRecord datasets: one for train and one for test. Each TFRecord dataset is comprised of a set of TF-Example protocol buffers, each of which contain a single image and label. The script should take several minutes to run. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function import os import sys import tarfile import numpy as np from six.moves import cPickle from six.moves import urllib import tensorflow as tf from datasets import dataset_utils # The URL where the CIFAR data can be downloaded. _DATA_URL = 'https://www.cs.toronto.edu/~kriz/cifar-10-python.tar.gz' # The number of training files. _NUM_TRAIN_FILES = 5 # The height and width of each image. _IMAGE_SIZE = 32 # The names of the classes. _CLASS_NAMES = [ 'airplane', 'automobile', 'bird', 'cat', 'deer', 'dog', 'frog', 'horse', 'ship', 'truck', ] def _add_to_tfrecord(filename, tfrecord_writer, offset=0): """Loads data from the cifar10 pickle files and writes files to a TFRecord. Args: filename: The filename of the cifar10 pickle file. tfrecord_writer: The TFRecord writer to use for writing. offset: An offset into the absolute number of images previously written. Returns: The new offset. """ with tf.gfile.Open(filename, 'rb') as f: if sys.version_info < (3,): data = cPickle.load(f) else: data = cPickle.load(f, encoding='bytes') images = data[b'data'] num_images = images.shape[0] images = images.reshape((num_images, 3, 32, 32)) labels = data[b'labels'] with tf.Graph().as_default(): image_placeholder = tf.placeholder(dtype=tf.uint8) encoded_image = tf.image.encode_png(image_placeholder) with tf.Session('') as sess: for j in range(num_images): sys.stdout.write('\r>> Reading file [%s] image %d/%d' % ( filename, offset + j + 1, offset + num_images)) sys.stdout.flush() image = np.squeeze(images[j]).transpose((1, 2, 0)) label = labels[j] png_string = sess.run(encoded_image, feed_dict={image_placeholder: image}) example = dataset_utils.image_to_tfexample( png_string, b'png', _IMAGE_SIZE, _IMAGE_SIZE, label) tfrecord_writer.write(example.SerializeToString()) return offset + num_images def _get_output_filename(dataset_dir, split_name): """Creates the output filename. Args: dataset_dir: The dataset directory where the dataset is stored. split_name: The name of the train/test split. Returns: An absolute file path. """ return '%s/cifar10_%s.tfrecord' % (dataset_dir, split_name) def _download_and_uncompress_dataset(dataset_dir): """Downloads cifar10 and uncompresses it locally. Args: dataset_dir: The directory where the temporary files are stored. """ filename = _DATA_URL.split('/')[-1] filepath = os.path.join(dataset_dir, filename) if not os.path.exists(filepath): def _progress(count, block_size, total_size): sys.stdout.write('\r>> Downloading %s %.1f%%' % ( filename, float(count * block_size) / float(total_size) * 100.0)) sys.stdout.flush() filepath, _ = urllib.request.urlretrieve(_DATA_URL, filepath, _progress) print() statinfo = os.stat(filepath) print('Successfully downloaded', filename, statinfo.st_size, 'bytes.') tarfile.open(filepath, 'r:gz').extractall(dataset_dir) def _clean_up_temporary_files(dataset_dir): """Removes temporary files used to create the dataset. Args: dataset_dir: The directory where the temporary files are stored. """ filename = _DATA_URL.split('/')[-1] filepath = os.path.join(dataset_dir, filename) tf.gfile.Remove(filepath) tmp_dir = os.path.join(dataset_dir, 'cifar-10-batches-py') tf.gfile.DeleteRecursively(tmp_dir) def run(dataset_dir): """Runs the download and conversion operation. Args: dataset_dir: The dataset directory where the dataset is stored. """ if not tf.gfile.Exists(dataset_dir): tf.gfile.MakeDirs(dataset_dir) training_filename = _get_output_filename(dataset_dir, 'train') testing_filename = _get_output_filename(dataset_dir, 'test') if tf.gfile.Exists(training_filename) and tf.gfile.Exists(testing_filename): print('Dataset files already exist. Exiting without re-creating them.') return dataset_utils.download_and_uncompress_tarball(_DATA_URL, dataset_dir) # First, process the training data: with tf.python_io.TFRecordWriter(training_filename) as tfrecord_writer: offset = 0 for i in range(_NUM_TRAIN_FILES): filename = os.path.join(dataset_dir, 'cifar-10-batches-py', 'data_batch_%d' % (i + 1)) # 1-indexed. offset = _add_to_tfrecord(filename, tfrecord_writer, offset) # Next, process the testing data: with tf.python_io.TFRecordWriter(testing_filename) as tfrecord_writer: filename = os.path.join(dataset_dir, 'cifar-10-batches-py', 'test_batch') _add_to_tfrecord(filename, tfrecord_writer) # Finally, write the labels file: labels_to_class_names = dict(zip(range(len(_CLASS_NAMES)), _CLASS_NAMES)) dataset_utils.write_label_file(labels_to_class_names, dataset_dir) _clean_up_temporary_files(dataset_dir) print('\nFinished converting the Cifar10 dataset!')
TensorFlow/Recommendation/VAE-CF/scripts
scripts
benchmark
# Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. #! /bin/bash set -e set -x python prepare_dataset.py # performance with AMP for i in 1 2 4 8 16; do horovodrun -np $i -H localhost:$i python3 /code/main.py --train --use_tf_amp --results_dir /data/performance_amp_results/${i}gpu rm -rf /tmp/checkpoints done # performance without AMP for i in 1 2 4 8 16; do horovodrun -np $i -H localhost:$i python3 /code/main.py --train --results_dir /data/performance_fp32_results/${i}gpu rm -rf /tmp/checkpoints done # AMP accuracy for multiple seeds for i in $(seq 20); do horovodrun -np 8 -H localhost:8 python3 /code/main.py --train --use_tf_amp --seed $i --results_dir /data/amp_accuracy_results/seed_${i} rm -rf /tmp/checkpoints done # FP32 accuracy for multiple seeds for i in $(seq 20); do horovodrun -np 8 -H localhost:8 python3 /code/main.py --train --seed $i --results_dir /data/fp32_accuracy_results/seed_${i} rm -rf /tmp/checkpoints done
TensorFlow/Detection/SSD/models/research/object_detection/builders
builders
anchor_generator_builder
# Copyright 2017 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== """A function to build an object detection anchor generator from config.""" from object_detection.anchor_generators import grid_anchor_generator from object_detection.anchor_generators import multiple_grid_anchor_generator from object_detection.anchor_generators import multiscale_grid_anchor_generator from object_detection.protos import anchor_generator_pb2 def build(anchor_generator_config): """Builds an anchor generator based on the config. Args: anchor_generator_config: An anchor_generator.proto object containing the config for the desired anchor generator. Returns: Anchor generator based on the config. Raises: ValueError: On empty anchor generator proto. """ if not isinstance(anchor_generator_config, anchor_generator_pb2.AnchorGenerator): raise ValueError('anchor_generator_config not of type ' 'anchor_generator_pb2.AnchorGenerator') if anchor_generator_config.WhichOneof( 'anchor_generator_oneof') == 'grid_anchor_generator': grid_anchor_generator_config = anchor_generator_config.grid_anchor_generator return grid_anchor_generator.GridAnchorGenerator( scales=[float(scale) for scale in grid_anchor_generator_config.scales], aspect_ratios=[float(aspect_ratio) for aspect_ratio in grid_anchor_generator_config.aspect_ratios], base_anchor_size=[grid_anchor_generator_config.height, grid_anchor_generator_config.width], anchor_stride=[grid_anchor_generator_config.height_stride, grid_anchor_generator_config.width_stride], anchor_offset=[grid_anchor_generator_config.height_offset, grid_anchor_generator_config.width_offset]) elif anchor_generator_config.WhichOneof( 'anchor_generator_oneof') == 'ssd_anchor_generator': ssd_anchor_generator_config = anchor_generator_config.ssd_anchor_generator anchor_strides = None if ssd_anchor_generator_config.height_stride: anchor_strides = zip(ssd_anchor_generator_config.height_stride, ssd_anchor_generator_config.width_stride) anchor_offsets = None if ssd_anchor_generator_config.height_offset: anchor_offsets = zip(ssd_anchor_generator_config.height_offset, ssd_anchor_generator_config.width_offset) return multiple_grid_anchor_generator.create_ssd_anchors( num_layers=ssd_anchor_generator_config.num_layers, min_scale=ssd_anchor_generator_config.min_scale, max_scale=ssd_anchor_generator_config.max_scale, scales=[float(scale) for scale in ssd_anchor_generator_config.scales], aspect_ratios=ssd_anchor_generator_config.aspect_ratios, interpolated_scale_aspect_ratio=( ssd_anchor_generator_config.interpolated_scale_aspect_ratio), base_anchor_size=[ ssd_anchor_generator_config.base_anchor_height, ssd_anchor_generator_config.base_anchor_width ], anchor_strides=anchor_strides, anchor_offsets=anchor_offsets, reduce_boxes_in_lowest_layer=( ssd_anchor_generator_config.reduce_boxes_in_lowest_layer)) elif anchor_generator_config.WhichOneof( 'anchor_generator_oneof') == 'multiscale_anchor_generator': cfg = anchor_generator_config.multiscale_anchor_generator return multiscale_grid_anchor_generator.MultiscaleGridAnchorGenerator( cfg.min_level, cfg.max_level, cfg.anchor_scale, [float(aspect_ratio) for aspect_ratio in cfg.aspect_ratios], cfg.scales_per_octave, cfg.normalize_coordinates ) else: raise ValueError('Empty anchor generator.')
PyTorch/LanguageModeling/BERT/scripts/docker
docker
build
#!/bin/bash URL=${1:-"bert"} PUSH=${2:-"none"} # 'push' or 'none' set -e docker build \ --network=host \ --rm \ --pull \ --no-cache \ -t ${URL} \ . if [ "${PUSH}" == "push" ]; then docker push ${URL} elif [ "${PUSH}" == "none" ]; then echo "Keep the built image locally." else echo "Invalid \${PUSH} option: ${PUSH} !" exit 1 fi
TensorFlow2/Segmentation/MaskRCNN/mrcnn_tf2
mrcnn_tf2
arguments
# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. """ Command line argument parser """ import argparse # =================================================================== # Parser setup # =================================================================== class CustomFormatter(argparse.ArgumentDefaultsHelpFormatter, argparse.RawTextHelpFormatter): pass # noinspection PyTypeChecker PARSER = argparse.ArgumentParser( usage='main.py MODE [arguments...]', description='NVIDIA implementation of MastRCNN for TensorFlow 2.x', formatter_class=lambda prog: CustomFormatter(prog, max_help_position=100), add_help=False ) RUNTIME_GROUP = PARSER.add_argument_group('Runtime') HYPER_GROUP = PARSER.add_argument_group('Hyperparameters') LOGGING_GROUP = PARSER.add_argument_group('Logging') UTILITY_GROUP = PARSER.add_argument_group('Utility') # =================================================================== # Runtime arguments # =================================================================== RUNTIME_GROUP.add_argument( 'mode', type=str, metavar='MODE', help=( 'One of supported execution modes:' '\n\ttrain - run in training mode' '\n\teval - run evaluation on eval data split' '\n\tinfer - run inference on eval data split' ), choices=[ 'train', 'eval', 'infer' ] ) RUNTIME_GROUP.add_argument( '--data_dir', type=str, default='/data', metavar='DIR', help='Input directory containing the dataset' ) RUNTIME_GROUP.add_argument( '--model_dir', type=str, default='/results', metavar='DIR', help='Output directory for information related to the model' ) RUNTIME_GROUP.add_argument( '--backbone_checkpoint', type=str, default='/weights/rn50_tf_amp_ckpt_v20.06.0/nvidia_rn50_tf_amp', metavar='FILE', help='Pretrained checkpoint for resnet' ) RUNTIME_GROUP.add_argument( '--eval_file', type=str, default='/data/annotations/instances_val2017.json', metavar='FILE', help='Path to the validation json file' ) RUNTIME_GROUP.add_argument( '--epochs', type=int, default=12, help='Number of training epochs' ) RUNTIME_GROUP.add_argument( '--steps_per_epoch', type=int, help='Number of steps (batches) per epoch. Defaults to dataset size divided by batch size.' ) RUNTIME_GROUP.add_argument( '--eval_samples', type=int, default=None, metavar='N', help='Number of evaluation samples' ) # =================================================================== # Hyperparameters arguments # =================================================================== HYPER_GROUP.add_argument( '--train_batch_size', type=int, default=4, metavar='N', help='Batch size (per GPU) used during training' ) HYPER_GROUP.add_argument( '--eval_batch_size', type=int, default=8, metavar='N', help='Batch size used during evaluation' ) HYPER_GROUP.add_argument( '--seed', type=int, default=None, metavar='SEED', help='Set a constant seed for reproducibility' ) HYPER_GROUP.add_argument( '--l2_weight_decay', type=float, default=1e-4, metavar='L2D', help='Weight of l2 regularization' ) HYPER_GROUP.add_argument( '--init_learning_rate', type=float, default=0.0, metavar='LR', help='Initial learning rate' ) HYPER_GROUP.add_argument( '--learning_rate_values', type=float, nargs='*', default=[1e-2, 1e-3, 1e-4], metavar='D', help='Learning rate decay levels that are then scaled by global batch size' ) HYPER_GROUP.add_argument( '--learning_rate_boundaries', type=float, nargs='*', metavar='N', default=[0.3, 8.0, 10.0], help='Steps (in epochs) at which learning rate changes' ) HYPER_GROUP.add_argument( '--momentum', type=float, default=0.9, help='Optimizer momentum' ) HYPER_GROUP.add_argument( '--finetune_bn', action='store_true', help='Is batchnorm finetuned training mode' ) HYPER_GROUP.add_argument( '--use_synthetic_data', action='store_true', help='Use synthetic input data, meant for testing only' ) HYPER_GROUP.add_argument( '--xla', action='store_true', help='Enable XLA JIT Compiler' ) HYPER_GROUP.add_argument( '--amp', action='store_true', help='Enable automatic mixed precision' ) # =================================================================== # Logging arguments # =================================================================== LOGGING_GROUP.add_argument( '--log_file', type=str, default='mrcnn-dlll.json', metavar='FILE', help='Output file for DLLogger logs' ) LOGGING_GROUP.add_argument( '--log_every', type=int, default=100, metavar='N', help='Log performance every N steps' ) LOGGING_GROUP.add_argument( '--log_warmup_steps', type=int, default=100, metavar='N', help='Number of steps that will be ignored when collecting perf stats' ) LOGGING_GROUP.add_argument( '--log_graph', action='store_true', help='Print details about TF graph' ) LOGGING_GROUP.add_argument( '--log_tensorboard', type=str, metavar='PATH', help='When provided saves tensorboard logs to given dir' ) # =================================================================== # Utility arguments # =================================================================== UTILITY_GROUP.add_argument( '-h', '--help', action='help', help='Show this help message and exit' ) UTILITY_GROUP.add_argument( '-v', '--verbose', action='store_true', help='Displays debugging logs' ) UTILITY_GROUP.add_argument( '--eagerly', action='store_true', help='Runs model in eager mode. Use for debugging only as it reduces performance.' )
PyTorch/LanguageModeling/BART/scripts
scripts
run_pretraining
#!/usr/bin/env bash # Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================== echo "Container nvidia build = " $NVIDIA_BUILD_ID train_batch_size_phase1=${1:-200} train_batch_size_phase2=${2:-32} learning_rate_phase1=${3:-"5e-3"} learning_rate_phase2=${4:-"4e-3"} precision=${5:-"bf16"} use_preln=${6:-"true"} num_gpus=${7:-8} warmup_steps_phase1=${8:-"2166"} warmup_steps_phase2=${9:-"200"} train_steps_phase1=${10:-95040} train_steps_phase2=${11:-7560} save_checkpoints_steps=${12:-100} num_accumulation_steps_phase1=${13:-40} num_accumulation_steps_phase2=${14:-120} config_path=${15:-"configs/config.json"} DATA_DIR=data export DATA_DIR=$DATA_DIR printf -v TAG "bart_pyt_pretraining" RESULTS_DIR=${RESULTS_DIR:-results/${TAG}} printf "Saving checkpoints to %s\n" "$RESULTS_DIR" export RESULTS_DIR=$RESULTS_DIR printf -v SCRIPT_ARGS "%d %d %e %e %s %s %d %d %d %d %d %d %d %d %s" \ $train_batch_size_phase1 $train_batch_size_phase2 $learning_rate_phase1 \ $learning_rate_phase2 "$precision" "$use_preln" $num_gpus $warmup_steps_phase1 \ $warmup_steps_phase2 $train_steps_phase1 $train_steps_phase2 $save_checkpoints_steps \ $num_accumulation_steps_phase1 $num_accumulation_steps_phase2 "$config_path" set -x # RUN PHASE 1 bash scripts/run_pretraining_phase1.sh $SCRIPT_ARGS # RUN PHASE 2 bash scripts/run_pretraining_phase2.sh $SCRIPT_ARGS set +x
PyTorch/Detection/Efficientdet/effdet
effdet
__init__
# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License.
PyTorch/SpeechSynthesis/Tacotron2/filelists
filelists
ljs_mel_text_train_subset_2500_filelist
LJSpeech-1.1/mels/LJ026-0104.pt|so starch manufactured in the leaves must be digested (dissolved) before it can be transported. LJSpeech-1.1/mels/LJ012-0101.pt|They had had serious work to get at the diamonds. It was necessary to force one heavy door from its hinges, and to cut through the thick panels of another. LJSpeech-1.1/mels/LJ012-0130.pt|brought in a man-of-war from Brazil had been transhipped at Falmouth for conveyance to London. LJSpeech-1.1/mels/LJ034-0049.pt|so no conclusions can be drawn as to whether these remaining prints preceded or followed the print developed in Dallas by powder. LJSpeech-1.1/mels/LJ011-0271.pt|Mr. Gee went in the coach sent for him, and alighted at twenty-seven, York Street, West, Commercial Road. LJSpeech-1.1/mels/LJ016-0393.pt|called for a roast duck directly he entered the condemned cell. LJSpeech-1.1/mels/LJ009-0256.pt|Still he resisted. LJSpeech-1.1/mels/LJ032-0195.pt|The Commission was able to conclude, however, that the fibers most probably came from Oswald's shirt. LJSpeech-1.1/mels/LJ032-0016.pt|and (eight) Oswald's capability with a rifle. LJSpeech-1.1/mels/LJ043-0053.pt|and became quite incensed with his wife when she would open the door for her in spite of his instructions to the contrary. LJSpeech-1.1/mels/LJ008-0162.pt|Cries of Murder! murder! were now raised, and added greatly to the horrors of the scene. LJSpeech-1.1/mels/LJ027-0026.pt|lead to a preview of certain principles of adaptation, necessary for their interpretation. LJSpeech-1.1/mels/LJ037-0073.pt|Addressing itself solely to the probative value of Mrs. Markham's contemporaneous description of the gunman LJSpeech-1.1/mels/LJ048-0182.pt|President Kennedy himself had mentioned it that morning, as had Agent Sorrels when he and Agent Lawson were fixing the motorcade route. LJSpeech-1.1/mels/LJ048-0199.pt|and arrest any person who might attempt to throw anything or try to get at the President and his party; LJSpeech-1.1/mels/LJ040-0104.pt|when he was sent to New Orleans to visit the family of his mother's sister, Mrs. Lillian Murret, for two or three weeks. LJSpeech-1.1/mels/LJ018-0312.pt|A plot was soon discovered, LJSpeech-1.1/mels/LJ016-0193.pt|Foxen asked him his name and address, and went away. LJSpeech-1.1/mels/LJ014-0330.pt|He had several narrow escapes. LJSpeech-1.1/mels/LJ028-0309.pt|After the twenty days are over, bid thy whole army attack the city on every side, and put me two bodies of Persians, LJSpeech-1.1/mels/LJ018-0321.pt|An increase of policemen on duty sufficed to prevent any attempt of this kind. LJSpeech-1.1/mels/LJ030-0039.pt|Men the motorcade slows or stops, agents take positions between the President and the crowd. LJSpeech-1.1/mels/LJ009-0290.pt|He was at first engaged as assistant to the executioner Tom Cheshire, but in due course rose to be chief. LJSpeech-1.1/mels/LJ038-0301.pt|(two) the photographs found among Oswald's possessions, LJSpeech-1.1/mels/LJ022-0028.pt|I am reminded sometimes of what President Wilson once said: LJSpeech-1.1/mels/LJ006-0214.pt|but no steps were taken to prevent any prisoner from obtaining more if he could pay for it. LJSpeech-1.1/mels/LJ047-0209.pt|that he had owned a weapon and did a good deal of hunting or use of it, perhaps in Russia, plus a number of items about his disposition and unreliability of character, LJSpeech-1.1/mels/LJ046-0140.pt|any communication, quote, that in any way indicates anyone may have possible intention of harming the President, end quote. LJSpeech-1.1/mels/LJ016-0415.pt|but the story was never substantiated, and we may hope that it rested only on the idle gossip of the day. LJSpeech-1.1/mels/LJ048-0106.pt|Much of Lawson's time was taken with establishing adequate security over the motorcade route and at the two places where the President would stop, LJSpeech-1.1/mels/LJ045-0030.pt|when his wife asked Oswald not to come to Irving. LJSpeech-1.1/mels/LJ001-0067.pt|In the Low Countries and Cologne, which were very fertile of printed books, Gothic was the favorite. LJSpeech-1.1/mels/LJ003-0320.pt|which recommended restrictions upon the number of visitors admitted. LJSpeech-1.1/mels/LJ018-0340.pt|characterized this as a crime more black and hideous than any in the criminal annals of the country. LJSpeech-1.1/mels/LJ045-0114.pt|Oswald also said that he did not want the FBI to know where he lived, quote, Because their visits were not very pleasant for him LJSpeech-1.1/mels/LJ038-0092.pt|Oswald provided little information during his questioning. LJSpeech-1.1/mels/LJ030-0047.pt|The occupants scanned the crowd and the buildings along the route. LJSpeech-1.1/mels/LJ033-0024.pt|Oswald replied, quote, I'm going home to get some curtain rods to put in an apartment, end quote. LJSpeech-1.1/mels/LJ010-0081.pt|One of the conspirators, by name Edwards, LJSpeech-1.1/mels/LJ028-0406.pt|The great irrigating dams across the Euphrates are constructed entirely of them. LJSpeech-1.1/mels/LJ048-0230.pt|and by a Secret Service investigation. LJSpeech-1.1/mels/LJ039-0053.pt|was of no probative value in the Commission's decision concerning the identity of the assassin of President Kennedy. LJSpeech-1.1/mels/LJ034-0039.pt|In Latona's opinion, quote, LJSpeech-1.1/mels/LJ039-0013.pt|and to the Commission on February twenty-one. LJSpeech-1.1/mels/LJ027-0160.pt|that the embryo or larva of a frog or toad, when first hatched, is a legless, tail-swimming, water-breathing, gill-breathing animal. LJSpeech-1.1/mels/LJ014-0283.pt|The jury found him guilty of the latter only, with a point of law reserved. This was fully argued before three judges, LJSpeech-1.1/mels/LJ014-0166.pt|faded in my mind before the atrocious bearing, looks, and language of the assembled spectators. LJSpeech-1.1/mels/LJ013-0093.pt|where the cash was transferred from the carpet-bag to a portmanteau. LJSpeech-1.1/mels/LJ005-0208.pt|the only aperture through which air could be admitted being an iron grating level with the street, LJSpeech-1.1/mels/LJ028-0303.pt|I think they will believe my words and entrust me with a command of troops. Thou, on thy part, must wait LJSpeech-1.1/mels/LJ030-0146.pt|Just prior to the shooting, David F. Powers, riding in the Secret Service follow-up car, remarked to Kenneth O'Donnell LJSpeech-1.1/mels/LJ003-0305.pt|The provision of more baths was also suggested, and the daily sweeping out of the prison. LJSpeech-1.1/mels/LJ017-0068.pt|and public opinion at the termination of the trial coincided with the verdict of the jury. LJSpeech-1.1/mels/LJ014-0136.pt|the culprit was really her husband, who killed O'Connor out of jealousy and revengeful feelings. LJSpeech-1.1/mels/LJ041-0042.pt|He wrote a note in his mother's name to school authorities in New Orleans saying that he was leaving school because he and his mother were moving to San Diego. LJSpeech-1.1/mels/LJ012-0053.pt|He was conveyed in a coach driven by a confederate, and under the escort of a couple of turnkeys. LJSpeech-1.1/mels/LJ048-0094.pt|Lawson was responsible for working out a great many arrangements for the President's trip. LJSpeech-1.1/mels/LJ033-0197.pt|quote, in all observable microscopic characteristics, end quote. LJSpeech-1.1/mels/LJ015-0142.pt|He soon proved his ability, and by unremitting attention mastered the whole work of the office. LJSpeech-1.1/mels/LJ012-0152.pt|which he refused to redeem on account of the row about the robbery. LJSpeech-1.1/mels/LJ018-0208.pt|were a low lot, the lowest among criminals except, perhaps, the 'smashers,' or those who passed the counterfeit money. LJSpeech-1.1/mels/LJ020-0017.pt|Now whip up the batter with a wooden spoon for another minute, and the sponge is made. LJSpeech-1.1/mels/LJ021-0081.pt|with the confidence that we are definitely rebuilding our political and economic system on the lines laid down by the New Deal LJSpeech-1.1/mels/LJ005-0288.pt|when speaking more particularly of the borough jails. LJSpeech-1.1/mels/LJ045-0172.pt|Answer: He said he would buy me a washing machine. LJSpeech-1.1/mels/LJ032-0009.pt|(two) the means by which the weapon was brought into the Depository Building, LJSpeech-1.1/mels/LJ044-0148.pt|very unhappy, and that he actually wept when he told her that. LJSpeech-1.1/mels/LJ015-0279.pt|One stroke of luck which he turned to great account LJSpeech-1.1/mels/LJ034-0080.pt|When he reached the first floor, the west elevator -- the one with the gate was not there. LJSpeech-1.1/mels/LJ004-0089.pt|and to pay overseers or instructors out of the county rates. LJSpeech-1.1/mels/LJ044-0040.pt|He wrote that, quote, thousands of circulars were distributed, end quote. LJSpeech-1.1/mels/LJ045-0213.pt|The conversation on Monday, November eighteen, nineteen sixty-three, LJSpeech-1.1/mels/LJ029-0183.pt|On October three the Dallas Morning News quoted U.S. Representative Joe Pool's hope LJSpeech-1.1/mels/LJ014-0023.pt|and many of the same sort were found in the possession of the accused. This was enough to obtain a committal, LJSpeech-1.1/mels/LJ011-0291.pt|Two Bow Street runners were dispatched to the house in York Street, which had evidently been taken on purpose for the outrage. LJSpeech-1.1/mels/LJ045-0151.pt|He then arrived on Thursday, November twenty-one, nineteen sixty-three, end quote. LJSpeech-1.1/mels/LJ027-0088.pt|Extensive comparison, on the contrary, shows them to be the same, although the essential identity is obscured by adaptive modifications. LJSpeech-1.1/mels/LJ028-0352.pt|whether of former or of later times, except only Cyrus with whom no person ever yet thought himself worthy to compare. LJSpeech-1.1/mels/LJ031-0152.pt|Agents Kellerman and Hill telephoned the head of the White House detail, Gerald A. Behn, to advise him of the assassination. LJSpeech-1.1/mels/LJ025-0084.pt|And if we substitute for the possession of an alimentary cavity the power of taking solid nutriment into the body and there digesting it, LJSpeech-1.1/mels/LJ025-0149.pt|that, while locomotive, their movements may have as much appearance of spontaneity as those of the lowest animals, LJSpeech-1.1/mels/LJ050-0158.pt|the Department hopes to design a practical system which will fully meet the needs of the Protective Research Section of the Secret Service. LJSpeech-1.1/mels/LJ030-0123.pt|Special Agent Glen A. Bennett once left his place inside the follow-up car to help keep the crowd away from the President's car. LJSpeech-1.1/mels/LJ022-0089.pt|charged with carrying on work relief projects. LJSpeech-1.1/mels/LJ030-0008.pt|During the afternoon, President Kennedy dedicated the U.S. Air Force School of Aerospace Medicine at Brooks Air Force Base. LJSpeech-1.1/mels/LJ007-0059.pt|had relaxed his efforts, because, according to his own account, he was so frequently stopped in the performance of his duties. LJSpeech-1.1/mels/LJ037-0258.pt|There is no doubt, however, that Oswald was seen leaving his roominghouse at about one p.m. wearing a zipper jacket, LJSpeech-1.1/mels/LJ039-0062.pt|the shots were at a slow-moving target proceeding on a downgrade in virtually a straight line LJSpeech-1.1/mels/LJ032-0199.pt|the Oswalds lived on Neely Street in Dallas in a rented house which had a small back yard. LJSpeech-1.1/mels/LJ014-0244.pt|which offered peculiar chances of profit to an ingenious and unscrupulous man. LJSpeech-1.1/mels/LJ040-0128.pt|He was in Youth House from April sixteen to May seven, nineteen fifty-three, LJSpeech-1.1/mels/LJ042-0062.pt|It shows how willing he was to act dramatically and decisively when he faced an emotional crisis LJSpeech-1.1/mels/LJ050-0007.pt|have made it difficult for the Treasury to maintain close and continuing supervision. LJSpeech-1.1/mels/LJ028-0021.pt|Again, long before the stars have been scattered by the morning sun, you are on your way. LJSpeech-1.1/mels/LJ030-0033.pt|Vice President and Mrs. Johnson followed along the fence, guarded by four members of the Vice-Presidential detail. LJSpeech-1.1/mels/LJ033-0123.pt|that the bag she saw Oswald carrying, quote, wasn't that long, I mean it was folded down at the top as I told you. It definitely wasn't that long, end quote, LJSpeech-1.1/mels/LJ009-0130.pt|winked at other prisoners in derision of what was taking place; and I have frequently heard men and lads who had been of the kneeling party LJSpeech-1.1/mels/LJ035-0201.pt|The fact that Truly found Fritz in the northwest corner of the floor, near the point where the rifle was found, supports Fritz' recollection. LJSpeech-1.1/mels/LJ031-0113.pt|This operation was concluded at three:twenty p.m. LJSpeech-1.1/mels/LJ014-0025.pt|A witness deposed to meeting Hocker, soon after the cries of murder were heard, LJSpeech-1.1/mels/LJ014-0007.pt|He entered into conversation with the policemen, and learnt, as it seemed for the first time, what had happened. LJSpeech-1.1/mels/LJ009-0110.pt|This exhibition lasts for some minutes, and then the congregation disperses, LJSpeech-1.1/mels/LJ035-0090.pt|possible delayed reaction to the shot, jostling with the crowd of people on the steps and scanning the area along Elm Street and the parkway. LJSpeech-1.1/mels/LJ028-0449.pt|Parts of the walls of Nineveh are still standing to the height of one hundred and twenty-five feet, LJSpeech-1.1/mels/LJ050-0210.pt|the caseload of each FBI agent averaged twenty to twenty-five, and he felt that this was high. LJSpeech-1.1/mels/LJ021-0119.pt|including a few of major importance. LJSpeech-1.1/mels/LJ003-0279.pt|There was fear as to the unrestricted use of tools, LJSpeech-1.1/mels/LJ031-0184.pt|Swearing in of the New President LJSpeech-1.1/mels/LJ027-0030.pt|is associated with an adaptive modification of locomotor structures, legs and wings, LJSpeech-1.1/mels/LJ006-0155.pt|He may have erred in some points through ignorance, but in others he was clearly guilty of culpable neglect. LJSpeech-1.1/mels/LJ025-0053.pt|to the investigation of organic structure, LJSpeech-1.1/mels/LJ047-0027.pt|In this way, it learned that when Oswald had arrived in the Soviet Union LJSpeech-1.1/mels/LJ033-0046.pt|went out to the garage to paint some children's blocks, and worked in the garage for half an hour or so. LJSpeech-1.1/mels/LJ037-0038.pt|at the southeast corner of the intersection, approximately fifty feet away. LJSpeech-1.1/mels/LJ003-0117.pt|A bribe to the judge was certain to secure acquittal, and the neglect of the formality was as certainly followed by condemnation. LJSpeech-1.1/mels/LJ030-0208.pt|Hill heard a noise, which seemed to be a firecracker, coming from his right rear. LJSpeech-1.1/mels/LJ010-0041.pt|or like Cannon the chimney-sweeper, who savagely killed the policeman. LJSpeech-1.1/mels/LJ002-0122.pt|The number of arrests actually made was one hundred fourteen thousand, three hundred for the kingdom, and seven thousand twenty for Middlesex. LJSpeech-1.1/mels/LJ032-0080.pt|were a Selective Service notice of classification and a Marine certificate of service in the name of Alek James Hidell. LJSpeech-1.1/mels/LJ036-0101.pt|He was taken to the lineup room where, according to Whaley, five young teenagers, all handcuffed together, were displayed with Oswald. LJSpeech-1.1/mels/LJ044-0233.pt|Oswald was carrying only thirteen dollars, eighty-seven cents at the time of his arrest, although he had left, apparently by design, LJSpeech-1.1/mels/LJ015-0134.pt|had assets in the shape of land, house, furniture, pictures, and objets d'art to the value of fifty thousand pounds. LJSpeech-1.1/mels/LJ021-0067.pt|a rise from a deficit figure in the first quarter of nineteen thirty-three LJSpeech-1.1/mels/LJ001-0121.pt|in reading the modern figures the eyes must be strained before the reader can have any reasonable assurance LJSpeech-1.1/mels/LJ038-0304.pt|on April ten, nineteen sixty-three. LJSpeech-1.1/mels/LJ014-0089.pt|For the remainder of that week and part of the next the murderers stayed in the house, and occupied the kitchen, close to the remains of their victim. LJSpeech-1.1/mels/LJ008-0209.pt|Soon after midnight on the Sunday night, for by this time the present practice of executing on Monday morning had been pretty generally introduced, LJSpeech-1.1/mels/LJ028-0336.pt|Darius now, still keeping to the plan agreed upon, LJSpeech-1.1/mels/LJ031-0102.pt|Governor Connally was originally seen by Dr. Carrico and Dr. Richard Dulany. LJSpeech-1.1/mels/LJ009-0133.pt|the outside public continued to be excluded from the Newgate chapel on the day the condemned sermon was preached. LJSpeech-1.1/mels/LJ006-0177.pt|and it was not the least part of the blame imputed to him that he made special favorites of particular prisoners, retaining of his own accord in Newgate, LJSpeech-1.1/mels/LJ049-0098.pt|In nineteen oh two bills passed both Houses of Congress but failed of enactment when the Senate refused to accept the conference report. LJSpeech-1.1/mels/LJ014-0176.pt|His determined addiction to evil courses had led to his being cast off by his family, LJSpeech-1.1/mels/LJ009-0301.pt|who deserted, and was pursued, but without success. LJSpeech-1.1/mels/LJ047-0013.pt|Finally, the Commission has reviewed the complete files on Oswald, as they existed at the time of the assassination, of the Department of State, LJSpeech-1.1/mels/LJ037-0157.pt|taken from Oswald. LJSpeech-1.1/mels/LJ041-0087.pt|as a means of getting or attempting to get sympathy, end quote. In Thornley's view, Oswald labored under a persecution complex LJSpeech-1.1/mels/LJ003-0090.pt|Mr. Newman admitted that he had petitioned that certain "trusty men" might be left in the jail. LJSpeech-1.1/mels/LJ040-0015.pt|There is, however, a large amount of material available in his writings LJSpeech-1.1/mels/LJ007-0068.pt|generally sided with his opponents. Nevertheless the inspectors summed up against him. LJSpeech-1.1/mels/LJ029-0148.pt|for controlling the crowds and traffic, watching the overpasses, and providing motorcycle escort. LJSpeech-1.1/mels/LJ035-0205.pt|and no one could be found who saw Oswald anywhere else in the building until after the shooting. LJSpeech-1.1/mels/LJ017-0269.pt|let down. A full view of them was thus at all times obtainable by the officers who, without intermission, day and night patrolled the ward. LJSpeech-1.1/mels/LJ010-0304.pt|through advances made to various builders, and that it could only maintain its credit by wholesale discounting. LJSpeech-1.1/mels/LJ025-0138.pt|The results of inquiries into the structure of the nervous system of animals LJSpeech-1.1/mels/LJ005-0262.pt|it was suggested that the rules framed for prison government should be subjected to the Secretary of State for approval, LJSpeech-1.1/mels/LJ020-0105.pt|Weave the little duties in and under and among what seem to be the greater. LJSpeech-1.1/mels/LJ010-0313.pt|the sum total amounting to some one hundred seventy thousand pounds, with a declaration in his own handwriting to the following effect. LJSpeech-1.1/mels/LJ014-0169.pt|It will be in the memory of many that Mrs. Manning appeared on the scaffold in a black satin dress, which was bound tightly round her waist. LJSpeech-1.1/mels/LJ020-0001.pt|Marion Harland's Cookery for Beginners. Bread Sponge and Breakfast Breads. LJSpeech-1.1/mels/LJ048-0047.pt|his presence in the School Book Depository job and its location along the route of the motorcade. LJSpeech-1.1/mels/LJ050-0145.pt|and the Commission recommends that these and the other measures suggested by the Commission be pursued vigorously by Secret Service. LJSpeech-1.1/mels/LJ010-0151.pt|Again, a soldier, by name Hatfield, who had been wounded in the head, and discharged from the army for unsoundness of mind, LJSpeech-1.1/mels/LJ016-0253.pt|that the ceremony may be made more mechanical, thus rendering the personal intervention of a skilled functionary unnecessary. LJSpeech-1.1/mels/LJ036-0078.pt|claimed that about fifteen minutes after the assassination he saw a man, whom he later identified as Oswald, LJSpeech-1.1/mels/LJ014-0066.pt|and by dint of usurious interest on small sums advanced to needy neighbors, had amassed as much as eight thousand pounds or ten thousand pounds. LJSpeech-1.1/mels/LJ040-0126.pt|Oswald was remanded for psychiatric observation to Youth House, an institution in which children are kept for psychiatric observation LJSpeech-1.1/mels/LJ009-0152.pt|The crowd outside Newgate on the day of execution has already been described; but there was also a select gathering of distinguished visitors within the jail. LJSpeech-1.1/mels/LJ007-0179.pt|defeats the ends of justice, and disgraces the profession of a Christian country. LJSpeech-1.1/mels/LJ028-0140.pt|The city stands on a broad plain, and is an exact square, a hundred and twenty furlongs in length each way, LJSpeech-1.1/mels/LJ033-0044.pt|In the garage were the personal belongings of the Oswald family including, as the evidence has shown, the rifle wrapped in the old brown and green blanket. LJSpeech-1.1/mels/LJ028-0472.pt|Its outer part, about twelve feet in width, was protected with towers at intervals of sixty-five feet. LJSpeech-1.1/mels/LJ044-0016.pt|which was berthed at the Dumaine Street wharf in New Orleans, on June sixteen, nineteen sixty-three. LJSpeech-1.1/mels/LJ031-0030.pt|Governor Connally, who had lost consciousness on the ride to the hospital, regained consciousness when the limousine stopped abruptly at the emergency entrance. LJSpeech-1.1/mels/LJ029-0011.pt|President Kennedy's visit to Texas in November nineteen sixty-three had been under consideration for almost a year before it occurred. LJSpeech-1.1/mels/LJ034-0157.pt|Brennan stated, quote, I could at that time -- I could, with all sincerity, identify him as being the same man, end quote. LJSpeech-1.1/mels/LJ023-0110.pt|a super-legislature, as one of the justices has called it LJSpeech-1.1/mels/LJ028-0231.pt|whereupon they withdrew within their defenses. LJSpeech-1.1/mels/LJ016-0163.pt|He might have saved himself at any moment by merely extending an arm; but he lay there patiently till death supervened. LJSpeech-1.1/mels/LJ003-0336.pt|but it at once deprecated the idea that the city could follow the laudable example thus set in the provinces. Quote, LJSpeech-1.1/mels/LJ016-0147.pt|Then he ran along the coping of the wall towards its angle with Tyler's manufactory, and dropped down on to the gridiron below. LJSpeech-1.1/mels/LJ036-0086.pt|The Commission could not accept important elements of Craig's testimony. LJSpeech-1.1/mels/LJ030-0241.pt|President Johnson emphasized Youngblood's instantaneous reaction after the first shot: LJSpeech-1.1/mels/LJ004-0058.pt|The untried, and in the eyes of the law still innocent, could claim pure air, wholesome and sufficient food, and opportunities for exercise. LJSpeech-1.1/mels/LJ003-0041.pt|There was no lack of air and light for the new jail, and several exercising yards. LJSpeech-1.1/mels/LJ048-0027.pt|Nowhere during the course of this investigation or the information that came to us from other agencies was there any indication of a potential for violence on his part. LJSpeech-1.1/mels/LJ048-0045.pt|his pro-Castro tendencies, his lies when interrogated by the FBI, LJSpeech-1.1/mels/LJ003-0217.pt|The condemned occupied an open pew in the center of the chapel, hung with black; in front of them, upon a table, was a black coffin in full view. LJSpeech-1.1/mels/LJ011-0061.pt|Let this monster give his name; I am ready to fight him. I am still determined to put myself in the place of Mr. Fauntleroy. LJSpeech-1.1/mels/LJ037-0127.pt|Four men -- Warren Reynolds, Harold Russell, Pat Patterson, and L. J. Lewis LJSpeech-1.1/mels/LJ029-0208.pt|It was fashioned after the "wanted" circulars issued by law enforcement agencies. LJSpeech-1.1/mels/LJ003-0236.pt|Garnish continued to be demanded long after it had disappeared in other and better-regulated prisons. LJSpeech-1.1/mels/LJ041-0036.pt|He was a little dismayed at this, and he said that he couldn't find any that would show any interest in him as a Communist, LJSpeech-1.1/mels/LJ007-0155.pt|to be subjected to the same baneful influences, and to suffer the same moral deterioration, whether ultimately convicted or set free. LJSpeech-1.1/mels/LJ028-0070.pt|and how, in punishment for all his wickedness, he became a calf, and for seven years grazed the grass in the fields about the city. LJSpeech-1.1/mels/LJ021-0136.pt|We have passed through more than a year of education. LJSpeech-1.1/mels/LJ013-0250.pt|In the same room a large axe and saw were found covered with blood. LJSpeech-1.1/mels/LJ002-0263.pt|the Lord Steward of the Household, the steward and officers of the Marshalsea Court, and others. LJSpeech-1.1/mels/LJ032-0162.pt|Stombaugh testified that the colors, shades, and twist of the fibers found in the tuft on the rifle matched those in Oswald's shirt. LJSpeech-1.1/mels/LJ038-0279.pt|I think is going overboard in the other direction. LJSpeech-1.1/mels/LJ048-0023.pt|and he had told us during one of the interviews that he would probably take his wife back to Soviet Russia some time in the future. LJSpeech-1.1/mels/LJ038-0118.pt|The Aliases "Hidell" and "O. H. Lee" LJSpeech-1.1/mels/LJ015-0139.pt|an open-handed, unthinking charity which gave freely to the poor and needy the money which belonged to his creditors. LJSpeech-1.1/mels/LJ015-0037.pt|and the partners had to decide between suspending payment or continuing to hold its head above water by flagitious processes. LJSpeech-1.1/mels/LJ025-0090.pt|and resemblances between the constituents of animal and vegetable organisms, for which Cuvier is not responsible, LJSpeech-1.1/mels/LJ012-0078.pt|One of the largest robberies of its class was that effected upon the Custom House in the winter of eighteen thirty-four. LJSpeech-1.1/mels/LJ021-0208.pt|into the service of the privileged few. LJSpeech-1.1/mels/LJ028-0245.pt|and mounting upon the walls along both sides of the stream, would so have caught the enemy as it were in a trap. LJSpeech-1.1/mels/LJ022-0010.pt|At different points on the coast where I often visit they build great seagoing ships. LJSpeech-1.1/mels/LJ017-0217.pt|Navigation and discipline could not be easy with such a nondescript crew. LJSpeech-1.1/mels/LJ010-0126.pt|A crowd as great as any known collected in the Old Bailey to see the ceremony, about which there were some peculiar features worth recording. LJSpeech-1.1/mels/LJ035-0046.pt|I was coming out this one on the second floor, and I don't know, I was kind of sweeping this area as I come up, I was looking from right to left LJSpeech-1.1/mels/LJ037-0166.pt|He concluded, however, that he could not say whether the four bullets were fired from the revolver in Oswald's possession. LJSpeech-1.1/mels/LJ045-0176.pt|The next morning he left for work before anyone else arose. LJSpeech-1.1/mels/LJ012-0264.pt|a warrant was issued for his apprehension, which was effected at Kennington on the twenty-fourth March. LJSpeech-1.1/mels/LJ014-0088.pt|This was on a Thursday evening. LJSpeech-1.1/mels/LJ032-0017.pt|Ownership And Possession Of Assassination Weapon LJSpeech-1.1/mels/LJ034-0093.pt|Brennan also testified that Lee Harvey Oswald, LJSpeech-1.1/mels/LJ045-0137.pt|I and my wife strongly protested these tactics by the notorious F.B.I., end quote. LJSpeech-1.1/mels/LJ004-0119.pt|which had continued through that long period, are forcibly pointed out. LJSpeech-1.1/mels/LJ005-0067.pt|The Prison Society reproves the misdirected efforts of ambitious architects, who by a lavish and improvident expenditure of public money LJSpeech-1.1/mels/LJ016-0080.pt|and probably one of the few cases of a recurrence, but under proper safeguards and limitations, to the old system of chains. LJSpeech-1.1/mels/LJ002-0078.pt|seven. The press yard was that part set aside for the condemned. LJSpeech-1.1/mels/LJ030-0043.pt|Its function was to alert police along the route that the motorcade was approaching and to check for signs of trouble. LJSpeech-1.1/mels/LJ003-0148.pt|and spent in providing coals, candles, plates, knives, and forks; while all the occupants of this part of the prison LJSpeech-1.1/mels/LJ033-0051.pt|Neither Marina Oswald nor Ruth Paine saw Oswald in the garage. LJSpeech-1.1/mels/LJ010-0176.pt|He was on the right or north side of the road. Prince Albert occupied the same side of the carriage, the Queen the left. LJSpeech-1.1/mels/LJ043-0153.pt|When asked if Oswald requested the note back she testified that, quote, He forgot about it. But apparently LJSpeech-1.1/mels/LJ018-0160.pt|They next watched Buncher, and found that he paid frequent visits to Birmingham. LJSpeech-1.1/mels/LJ018-0229.pt|The day his father died he got the keys of his private bureau, opened it, and took out the authentic will. LJSpeech-1.1/mels/LJ031-0204.pt|with three Secret Service agents, accompanied President Kennedy's body on the forty-five-minute automobile trip from Andrews Air Force Base to the hospital. LJSpeech-1.1/mels/LJ029-0184.pt|that President Kennedy would receive a "good welcome" and would not face demonstrations like those encountered LJSpeech-1.1/mels/LJ049-0229.pt|while assuming no radical relocation of responsibilities, LJSpeech-1.1/mels/LJ029-0136.pt|through the underpass and leads into an access road, LJSpeech-1.1/mels/LJ003-0228.pt|and the general insufficiency was such LJSpeech-1.1/mels/LJ033-0166.pt|Among other tests, the paper and tape were submitted to fiber analysis and spectrographic examination. LJSpeech-1.1/mels/LJ049-0033.pt|to move into the passenger section without hindrance or delay. Had the vehicle been so designed it is possible that an agent riding in the front seat LJSpeech-1.1/mels/LJ042-0121.pt|Mass gymnastics, compulsory afterwork meeting, usually political information meeting. LJSpeech-1.1/mels/LJ018-0344.pt|In cold-blooded premeditation it rivaled that of the Mannings. LJSpeech-1.1/mels/LJ003-0029.pt|Under the steward there were captains of wards, chosen in the same way, and performing analogous duties. LJSpeech-1.1/mels/LJ020-0099.pt|When habited for the day in all except the outer gown, collar, etc., slip on the wrapper again and run down to put the biscuits in the oven. LJSpeech-1.1/mels/LJ018-0214.pt|As the case must still be well remembered by the present generation, it will be necessary to give here only the briefest summary. LJSpeech-1.1/mels/LJ015-0130.pt|fifteen hundred pounds, which larger amount was duly carried to his credit on the register, and entered upon the certificates of transfer. LJSpeech-1.1/mels/LJ010-0105.pt|Thistlewood was discovered next morning in a mean house in White Street, Moorfields. LJSpeech-1.1/mels/LJ041-0163.pt|out of a combination of Oswald's known Marxist sympathies and George Orwell's book "nineteen eighty-four," one of Oswald's favorite books LJSpeech-1.1/mels/LJ006-0305.pt|The house at this time was full of men and visitors; waiters came in from the taverns with meals. LJSpeech-1.1/mels/LJ006-0010.pt|Mr. Samuel Hoare, when examined, considered it indispensably necessary, to carry out whatever system might be established, LJSpeech-1.1/mels/LJ009-0053.pt|but who is left to die on the supposition that this is not his first conviction, and still more because a good many sheep have of late been stolen by other people. LJSpeech-1.1/mels/LJ017-0145.pt|Dr. Smethurst was long an inmate of Newgate, and was tried at the Central Criminal Court. LJSpeech-1.1/mels/LJ035-0119.pt|until after they saw Patrolman Baker's white helmet on the fifth floor moving toward the elevator. LJSpeech-1.1/mels/LJ017-0177.pt|Wilson was acquitted on this charge, but other suspicious facts cropped up while she was in Newgate. LJSpeech-1.1/mels/LJ045-0044.pt|Many of the people with whom the Oswalds became acquainted after their arrival in the United States thought that Marina Oswald had married her husband primarily in the hope LJSpeech-1.1/mels/LJ008-0108.pt|The ordinary "gravely uttered, 'Come this way, Mr. Smith.' LJSpeech-1.1/mels/LJ010-0241.pt|but she declared she would not remain a prisoner in her own palace, and next day drove out as usual in an open barouche. LJSpeech-1.1/mels/LJ050-0237.pt|the FBI, on sixteen separate occasions, supplied a total of one hundred thirty-nine agents to assist in protection work during a Presidential visit, LJSpeech-1.1/mels/LJ032-0203.pt|on November twenty-two, nineteen sixty-three. One of these pictures, Exhibit Number one thirty-three A, shows most of the rifle's configuration. LJSpeech-1.1/mels/LJ005-0116.pt|but an empty regulation which all so disposed could defy. LJSpeech-1.1/mels/LJ047-0041.pt|Agent Fain reported to headquarters that Oswald was impatient and arrogant, LJSpeech-1.1/mels/LJ012-0178.pt|Thurtell drove him down in a gig, "to be killed as he traveled," in Thurtell's own words. LJSpeech-1.1/mels/LJ047-0193.pt|and so advised the Dallas office in the ordinary course of business. LJSpeech-1.1/mels/LJ006-0130.pt|had a key of both the master's side and middle side yards, was the only person present at the distribution of beer, and was trusted to examine, LJSpeech-1.1/mels/LJ009-0179.pt|the most recent enactment in force was the ninth George the fourth cap. thirty-one, which directed the dissection of all bodies of executed murderers, LJSpeech-1.1/mels/LJ012-0046.pt|The second house was in Lower Queen Street, Islington, and he used it for some time as a depot for valuables. LJSpeech-1.1/mels/LJ028-0483.pt|O Marduk, great god, look joyfully upon the precious work of my hands. Be thou my protector. LJSpeech-1.1/mels/LJ041-0127.pt|Oswald must have already learned that the Governor could not help him with his discharge because he was no longer Secretary of the Navy, at the time he made that remark. LJSpeech-1.1/mels/LJ012-0074.pt|Whether Ikey was "assigned" to his own family is not recorded, but no doubt he succeeded to his own property when the term of servitude had expired. LJSpeech-1.1/mels/LJ009-0029.pt|This episode throws some doubt upon the tenderness and proper feeling exhibited by the chaplain towards the most deserving members of his criminal flock; LJSpeech-1.1/mels/LJ032-0176.pt|Moreover, the bus transfer which he obtained as he left the bus was still in the pocket when he was arrested. LJSpeech-1.1/mels/LJ037-0107.pt|They saw a man coming south on Patton with a revolver held high in his right hand. According to Callaway, the man crossed to the west side of Patton. LJSpeech-1.1/mels/LJ004-0127.pt|In one hundred jails, LJSpeech-1.1/mels/LJ006-0077.pt|The fact was, he did not keep the classification of prisoners on first arrival in his own hands, nor even in that of his officers. LJSpeech-1.1/mels/LJ009-0259.pt|The wretched man did not fall with it, but jumped on to the platform, and seizing the rope with his hands, tried to avoid strangulation. LJSpeech-1.1/mels/LJ035-0128.pt|If her estimate of time is correct, she reached the bottom of the stairs before Truly and Baker started up, LJSpeech-1.1/mels/LJ005-0138.pt|that in four prisons, which at one time of the year contained one thousand three hundred eight prisoners, there were only sixty-eight sleeping rooms or cells, LJSpeech-1.1/mels/LJ040-0108.pt|which became more significant as the children grew older. LJSpeech-1.1/mels/LJ010-0167.pt|He left his last situation in April eighteen forty, and established himself in lodgings in Lambeth, LJSpeech-1.1/mels/LJ036-0107.pt|because he was bawling out the policeman, telling them it wasn't right to put him in line with these teenagers and all of that LJSpeech-1.1/mels/LJ044-0128.pt|there are a number of organizations, including possibly Fair Play, which are of a very broad character, LJSpeech-1.1/mels/LJ017-0125.pt|He never actually said that he was not guilty, but he was confident he would not be convicted. LJSpeech-1.1/mels/LJ039-0041.pt|I am getting a little confused with so many questions. LJSpeech-1.1/mels/LJ003-0339.pt|could possibly afford. LJSpeech-1.1/mels/LJ003-0156.pt|All the money earned by prisoners was at their own disposal, and was spent almost habitually in drink, chambering, and wantonness. LJSpeech-1.1/mels/LJ035-0210.pt|On the basis of these findings the Commission has concluded that Oswald, at the time of the assassination, LJSpeech-1.1/mels/LJ010-0256.pt|Undeterred by the well-merited punishment which had overtaken Francis, LJSpeech-1.1/mels/LJ011-0013.pt|replaced the stock in the names of the original holders, who might otherwise have been completely ruined. LJSpeech-1.1/mels/LJ036-0148.pt|After a review of these inconsistencies in his testimony before the Commission, Whaley was interviewed again in Dallas. LJSpeech-1.1/mels/LJ019-0130.pt|since admirably developed in the convict prisons of this country. LJSpeech-1.1/mels/LJ028-0389.pt|St. Jerome said: LJSpeech-1.1/mels/LJ006-0195.pt|This was admitted in evidence by the turnkeys, and was proved by the appearance of the prison tables, which bore the marks of gaming-boards deeply cut into them. LJSpeech-1.1/mels/LJ048-0034.pt|no law enforcement agency had any information to connect Oswald with the attempted shooting of General Walker. LJSpeech-1.1/mels/LJ045-0243.pt|He does not appear to have been able to establish meaningful relationships with other people. He was perpetually discontented with the world around him. LJSpeech-1.1/mels/LJ016-0057.pt|As his coat was an encumbrance, he left it on the top of the third house in Newgate Street, and thus in shirt-sleeves, barefoot and bareheaded, LJSpeech-1.1/mels/LJ014-0061.pt|and Manning hoped to get some small Government appointment through his wife's interest. LJSpeech-1.1/mels/LJ013-0084.pt|Burgess fraudulently transferred consols to the above amount, standing in the name of Mr. Oxenford, to another party. LJSpeech-1.1/mels/LJ018-0126.pt|His object in visiting Whitchurch was to undermine the honesty of some workman in the mills; LJSpeech-1.1/mels/LJ038-0201.pt|James C. Cadigan, FBI handwriting expert, testified that this note was written by Lee Harvey Oswald. LJSpeech-1.1/mels/LJ019-0310.pt|which had long been admitted as indispensable, and had never as yet been properly obtained. LJSpeech-1.1/mels/LJ029-0182.pt|may not endorse him in 'sixty-four. LJSpeech-1.1/mels/LJ043-0066.pt|Some of his acquaintances, feeling that Oswald tried to impress people with the fact that he had lived and worked in Russia, were led to the belief LJSpeech-1.1/mels/LJ004-0132.pt|the old evils of indiscriminate association still continued unchecked. LJSpeech-1.1/mels/LJ042-0197.pt|seemed to place him in a situation in which he could not live with satisfaction either in the United States or in the Soviet Union. LJSpeech-1.1/mels/LJ018-0366.pt|Although sentence of death was passed on Edmunds, it was commuted to penal servitude for life; LJSpeech-1.1/mels/LJ010-0237.pt|A youth named Pearson had seen him present a pistol at the Queen's carriage, LJSpeech-1.1/mels/LJ049-0039.pt|to take a protective position in the passenger compartment before the third shot was fired. LJSpeech-1.1/mels/LJ049-0155.pt|while investigating a plot to assassinate President Cleveland, the Service assigned a small protective detail of agents to the White House. LJSpeech-1.1/mels/LJ008-0138.pt|and at his request the ordinary drew the cap further down over his face, when in an instant, LJSpeech-1.1/mels/LJ027-0139.pt|and developmental changes which may be observed during the life history of now existing individuals belonging to the same group of animals. LJSpeech-1.1/mels/LJ049-0010.pt|who responded to the unplanned event with dispatch. LJSpeech-1.1/mels/LJ005-0149.pt|The nature of the employment varied greatly in severity, especially the tread-wheel labor. LJSpeech-1.1/mels/LJ021-0041.pt|has been to clean up thoroughly unwholesome conditions in the field of investment. LJSpeech-1.1/mels/LJ032-0065.pt|In accordance with postal regulations, the portion of the application which lists names of persons, other than the applicant, entitled to receive mail LJSpeech-1.1/mels/LJ022-0020.pt|cause of clearer thinking and a better understanding, are considering the whole rather than a mere part relating to one section or to one crop, LJSpeech-1.1/mels/LJ035-0146.pt|saw him walk through the clerical office on the second floor toward the door leading to the front stairway. LJSpeech-1.1/mels/LJ018-0259.pt|he confessed that his whole life had been a gigantic mistake, and he was ready to make what atonement he could. LJSpeech-1.1/mels/LJ040-0113.pt|They moved shortly after Robert joined the Marines; they lived for a time with John Pic who was stationed there with the Coast Guard. LJSpeech-1.1/mels/LJ003-0239.pt|This imposition of fees left prisoners destitute on their discharge, without funds to support them in their first struggle to recommence life, LJSpeech-1.1/mels/LJ028-0011.pt|As the taps upon her shoulder are repeated, she stretches out her long neck, and with long strides makes for the eastern horizon; LJSpeech-1.1/mels/LJ041-0157.pt|He studied the Russian language, read a Russian language newspaper and seemed interested in what was going on in the Soviet Union. LJSpeech-1.1/mels/LJ015-0015.pt|A more distressing case stands next on the criminal records -- LJSpeech-1.1/mels/LJ001-0048.pt|his letter is admirably clear and regular, but at least as beautiful as any other Roman type. LJSpeech-1.1/mels/LJ006-0034.pt|They attended early and late; they mustered the prisoners, examined into their condition, LJSpeech-1.1/mels/LJ004-0124.pt|In four hundred and forty-five prisons no work of any description had been introduced for the employment of prisoners; LJSpeech-1.1/mels/LJ032-0106.pt|end quote. Hidell was a fictitious president of an organization of which Oswald was the only member. LJSpeech-1.1/mels/LJ002-0026.pt|in the three years between eighteen thirteen and eighteen sixteen, LJSpeech-1.1/mels/LJ043-0126.pt|told the prospective employer that Oswald was, quote, kinda peculiar sometimes and that he had some knowledge of the Russian language, end quote. LJSpeech-1.1/mels/LJ019-0338.pt|But discipline was to be maintained if necessary by punishment, LJSpeech-1.1/mels/LJ037-0077.pt|Barbara Jeanette Davis and Virginia Davis, were in an apartment of a multiple-unit house on the southeast corner of tenth and Patton LJSpeech-1.1/mels/LJ034-0206.pt|confirmed that Euins could neither describe the man in the window nor indicate his race. LJSpeech-1.1/mels/LJ006-0178.pt|and for years, felons who should have been sent beyond the seas. LJSpeech-1.1/mels/LJ037-0112.pt|Apparently he had reached for his gun; it lay beneath him outside of the holster. LJSpeech-1.1/mels/LJ028-0396.pt|they were supplied with food by keepers, and gave the king the opportunity of hunting whenever he felt inclined. LJSpeech-1.1/mels/LJ047-0187.pt|It was then my plan to interview Marina Oswald in detail concerning both herself and her husband's background. Question: LJSpeech-1.1/mels/LJ037-0220.pt|Approximately fifteen minutes before the shooting of Tippit, Oswald was seen leaving his roominghouse. LJSpeech-1.1/mels/LJ040-0014.pt|He cannot, of course, be questioned or observed by those charged with the responsibility for this report or by experts on their behalf. LJSpeech-1.1/mels/LJ045-0185.pt|he asked Frazier for a ride to Irving that night, stating falsely that he wanted to pick up some curtain rods to put in an apartment. LJSpeech-1.1/mels/LJ011-0261.pt|He was found guilty of an assault with intent, and sentenced to transportation for fourteen years. LJSpeech-1.1/mels/LJ046-0107.pt|Finally, the performance of those charged with the immediate responsibility of protecting the President on November twenty-two is reviewed. LJSpeech-1.1/mels/LJ023-0073.pt|The Court claimed the power to declare it unconstitutional and did so declare it. LJSpeech-1.1/mels/LJ048-0277.pt|He felt that each agent recognized the seriousness of the infraction and that there was no danger of a repetition. LJSpeech-1.1/mels/LJ018-0050.pt|His arguments were specious and evasive when pressed to confess. "Why should man confess to man?" he replied; LJSpeech-1.1/mels/LJ018-0170.pt|On the bed were twenty forged ten-pound notes complete and ready for use, and twenty-five five-pound notes. LJSpeech-1.1/mels/LJ017-0163.pt|either arsenic or antimony, or both, in small quantities, LJSpeech-1.1/mels/LJ003-0149.pt|supported themselves; they had the ration of prison bread only, LJSpeech-1.1/mels/LJ016-0268.pt|The remarks heard amongst the crowd were of coarse approval. LJSpeech-1.1/mels/LJ010-0180.pt|the Prince too rose to shield her with his person. Again, providentially, the bullet went wide of the mark, LJSpeech-1.1/mels/LJ030-0183.pt|As he told the driver, quote, Let's get out of here; we are hit, end quote, LJSpeech-1.1/mels/LJ014-0027.pt|A woman whom he called on the same evening declared he had worn a mackintosh, his coat was much torn, there was a stain of blood on his shirt-cuff, LJSpeech-1.1/mels/LJ039-0011.pt|toward any official of the United States. LJSpeech-1.1/mels/LJ016-0158.pt|It was that of a "Long Firm" swindler, by name Johnson, LJSpeech-1.1/mels/LJ048-0213.pt|watching his car, watching the sides, watching the crowds, giving advice or asking advice from the Chief LJSpeech-1.1/mels/LJ046-0050.pt|administrative, political. LJSpeech-1.1/mels/LJ019-0306.pt|while twenty-seven received less than six prisoners, and were in some instances absolutely tenantless. LJSpeech-1.1/mels/LJ030-0076.pt|It carried eight Secret Service agents -- two in the front seat, two in the rear, and two on each of the right and left running boards. LJSpeech-1.1/mels/LJ024-0005.pt|has reached the age of seventy and does not avail himself of the opportunity to retire on a pension, LJSpeech-1.1/mels/LJ004-0099.pt|Ventilators, hand and others, were to be supplied. LJSpeech-1.1/mels/LJ030-0113.pt|through thinly populated areas on the outskirts of Dallas. LJSpeech-1.1/mels/LJ019-0009.pt|or to insist upon the construction of prisons on the most approved plan. LJSpeech-1.1/mels/LJ048-0287.pt|It is conceivable that those men who had little sleep, and who had consumed alcoholic beverages, even in limited quantities, LJSpeech-1.1/mels/LJ023-0090.pt|It is the accusation of most distinguished justices of the present Supreme Court. LJSpeech-1.1/mels/LJ039-0198.pt|but to determine the maximum speed at which it could be fired. LJSpeech-1.1/mels/LJ016-0042.pt|The condition of the stone surface just mentioned assisted him in this, and he managed to get beyond the cistern to the railing below the chevaux-de-frise. LJSpeech-1.1/mels/LJ049-0116.pt|of such persons as have been constitutionally and lawfully provided to succeed thereto in case of a vacancy. It is important to this country LJSpeech-1.1/mels/LJ016-0400.pt|Wainwright's demeanor was one of reckless effrontery steadily maintained to the last. LJSpeech-1.1/mels/LJ048-0236.pt|There is no indication that any of the agents who visited the Cellar Coffee House had any intoxicating drink at that establishment. LJSpeech-1.1/mels/LJ008-0264.pt|But the murderers formed only a small proportion of the total number sentenced to death, and for the rest there was a long period of anxious suspense, LJSpeech-1.1/mels/LJ039-0165.pt|The target at two hundred sixty-five feet was placed to the right of the two hundred forty-foot target LJSpeech-1.1/mels/LJ035-0150.pt|As she approached her desk, she saw Oswald. LJSpeech-1.1/mels/LJ009-0199.pt|About this time I find that the bodies of two murderers, Clench and Mackay, LJSpeech-1.1/mels/LJ028-0516.pt|the strongest, the thickest, the loftiest, the most intricate, perhaps the most beautiful that ever protected a city, LJSpeech-1.1/mels/LJ042-0150.pt|Marina Oswald's judgment of her husband's state of mind may be substantiated by comparing material which he wrote in the Soviet Union LJSpeech-1.1/mels/LJ035-0081.pt|The second test followed immediately after the first. LJSpeech-1.1/mels/LJ013-0009.pt|This was the willful shipwreck and casting away of a vessel which, with her supposed cargo, had been heavily insured. LJSpeech-1.1/mels/LJ047-0232.pt|In his opinion, none of the information in the FBI files -- Oswald's defection, his Fair Play for Cuba activities in New Orleans, LJSpeech-1.1/mels/LJ006-0028.pt|Mr. Crawford was thoroughly versed in the still imperfectly understood science of prison management, and fully qualified for his new duties. LJSpeech-1.1/mels/LJ019-0168.pt|Renewed recommendations to provide employment resulted in the provision of a certain amount of oakum for picking, LJSpeech-1.1/mels/LJ002-0030.pt|Full details of the arrangements are to be found in Mr. Neild's "State of Prisons in England, Scotland, and Wales," published in eighteen twelve. LJSpeech-1.1/mels/LJ031-0208.pt|The hospital received the President's body for autopsy at approximately seven:thirty-five p.m. LJSpeech-1.1/mels/LJ023-0108.pt|We are under a Constitution, but the Constitution is what the judges say it is. LJSpeech-1.1/mels/LJ032-0021.pt|was a distributor of surplus Italian six point five-millimeter military rifles. During the evening of November twenty-two, nineteen sixty-three, LJSpeech-1.1/mels/LJ017-0171.pt|Smethurst was therefore given a free pardon for the offense of murder, LJSpeech-1.1/mels/LJ030-0096.pt|These agents performed for the Vice President the same functions that the agents in the Presidential follow-up car performed for the President. LJSpeech-1.1/mels/LJ015-0065.pt|Robson was of humble origin, but he was well educated, and he had some literary abilities. LJSpeech-1.1/mels/LJ032-0167.pt|He concluded, quote, There is no doubt in my mind that these fibers could have come from this shirt. LJSpeech-1.1/mels/LJ003-0265.pt|the thieves and burglars who carried on the active business of their profession, from which their confederates were temporarily debarred. LJSpeech-1.1/mels/LJ034-0218.pt|The Commission has determined that the employee was in fact Billy Lovelady, who identified himself in the picture. LJSpeech-1.1/mels/LJ028-0141.pt|so that the entire circuit is four hundred and eighty furlongs. LJSpeech-1.1/mels/LJ050-0140.pt|Secretary Dillon testified that the use of such liaison officers is the only effective way to insure that adequate liaison is maintained. LJSpeech-1.1/mels/LJ027-0115.pt|it will be suffered to dwindle away in successive generations, under the influence of certain natural causes. LJSpeech-1.1/mels/LJ009-0298.pt|which sets forth that the petitioner had been at great expense by sending clerks and agents to Liverpool and Shrewsbury to hire an executioner. LJSpeech-1.1/mels/LJ036-0008.pt|(one) positive identification of the killer by two eyewitnesses who saw the shooting LJSpeech-1.1/mels/LJ046-0019.pt|In this part of its inquiry the Commission has had full access to a major study of all phases of protective activities LJSpeech-1.1/mels/LJ001-0086.pt|are dazzling and unpleasant to the eye owing to the clumsy thickening and vulgar thinning of the lines: LJSpeech-1.1/mels/LJ010-0265.pt|and on his information handbills were circulated, giving the exact description of the deformed youth, who had a hump-back, LJSpeech-1.1/mels/LJ028-0154.pt|at the point where the city of the same name stands, eight days' journey from Babylon. LJSpeech-1.1/mels/LJ011-0285.pt|The door of his place of durance stood open, and Mr. Gee began to consider whether he might not escape. LJSpeech-1.1/mels/LJ047-0082.pt|for an extended tour of Western European countries, the Soviet Union, Finland, and Poland. LJSpeech-1.1/mels/LJ014-0100.pt|In the back kitchen one of the detectives remarked that the cement between certain stones looked lighter than the rest, and on trying it with a knife, LJSpeech-1.1/mels/LJ048-0272.pt|Chief Rowley testified LJSpeech-1.1/mels/LJ027-0057.pt|In all vertebrates, and in none other, the axis of this skeleton is a jointed backbone (vertebral column) LJSpeech-1.1/mels/LJ018-0062.pt|Christian Sattler was by birth a German. LJSpeech-1.1/mels/LJ015-0193.pt|By-and-by, when escape seemed hopeless, and after sentence, he suddenly degenerated into the lowest stamp of criminal, LJSpeech-1.1/mels/LJ004-0066.pt|or his health by forcing him at night into a damp, unventilated cell, with such crowds of companions as very speedily render the air foul and putrid; LJSpeech-1.1/mels/LJ018-0314.pt|Certain friends of the prisoners were watched, and found to be in communication with these warders, LJSpeech-1.1/mels/LJ034-0112.pt|The New Orleans police records of his arrest in August of nineteen sixty-three show a weight of one hundred thirty-six pounds. LJSpeech-1.1/mels/LJ031-0051.pt|He noted contusions, hematoma to the right of the larynx, which was deviated slightly to the left, LJSpeech-1.1/mels/LJ007-0025.pt|There were frequent quarrels and fights; shoes and other missiles were freely bandied about; LJSpeech-1.1/mels/LJ015-0148.pt|The choicest wines, the finest fruits, LJSpeech-1.1/mels/LJ045-0027.pt|During the period from Oswald's return from Mexico to the assassination, LJSpeech-1.1/mels/LJ047-0137.pt|On October three, Hosty reopened the case in Dallas to assist the New Orleans office. LJSpeech-1.1/mels/LJ002-0325.pt|or the sixpenny allowance was claimed for the creditors, which seldom happened, owing to the expense the process entailed. LJSpeech-1.1/mels/LJ045-0162.pt|He tried to start a conversation with me several times, but I would not answer. And he said that he didn't want me to be angry at him because this upsets him. LJSpeech-1.1/mels/LJ013-0096.pt|Suspicions were aroused when it was found that he had been employed in selling stock for Mr. Oxenford, which developed into certainty LJSpeech-1.1/mels/LJ031-0187.pt|Federal Judge Sarah T. Hughes hastened to the plane to administer the oath. LJSpeech-1.1/mels/LJ047-0009.pt|who interviewed Oswald after his return from the Soviet Union and prior to November twenty-two, nineteen sixty-three, LJSpeech-1.1/mels/LJ013-0035.pt|While lying in Newgate, awaiting removal to the convict ship, both prisoners made full confessions. LJSpeech-1.1/mels/LJ021-0003.pt|Three months have passed since I talked with you shortly after the adjournment of the Congress. LJSpeech-1.1/mels/LJ023-0131.pt|We must have men worthy and equipped to carry out impartial justice. LJSpeech-1.1/mels/LJ016-0311.pt|that any secrecy in the treatment of the condemned would invest them with a new and greater interest, which was much to be deprecated. LJSpeech-1.1/mels/LJ045-0174.pt|Thank you. That it would be better if he bought something for himself -- that I would manage. End quote. That night Oswald went to bed before his wife retired. LJSpeech-1.1/mels/LJ030-0037.pt|are designed to provide protection while permitting large numbers of people to see the President. LJSpeech-1.1/mels/LJ034-0082.pt|None of the Depository employees is known to have seen Oswald again until after the shooting. LJSpeech-1.1/mels/LJ004-0194.pt|No irons were worn except as a punishment. LJSpeech-1.1/mels/LJ043-0108.pt|Oswald's employment problems became more difficult. He left his wife and child at the home of a friend, Mrs. Ruth Paine, of Irving, Texas. LJSpeech-1.1/mels/LJ039-0081.pt|Referring to a rifle with a four-power telescope, Sergeant Zahm said, quote, LJSpeech-1.1/mels/LJ040-0200.pt|Furthermore she did not appear to understand her own relationship to Lee's psychological problems. LJSpeech-1.1/mels/LJ025-0069.pt|innumerable plants and free plant cells are known to pass the whole or part of their lives in an actively locomotive condition, LJSpeech-1.1/mels/LJ008-0184.pt|Precautions had been taken by the erection of barriers, and the posting of placards at all the avenues to the Old Bailey, on which was printed, LJSpeech-1.1/mels/LJ003-0121.pt|But all punishments might readily be commuted into a fine to be spent in gin for judge and jury. LJSpeech-1.1/mels/LJ047-0163.pt|According to Hosty, Mrs. Paine indicated that she thought she could find out where Oswald was living and would let him know. LJSpeech-1.1/mels/LJ021-0065.pt|but also to the owners and managers of industry because, LJSpeech-1.1/mels/LJ005-0089.pt|The religious and moral welfare of the prisoners were to be attended to, LJSpeech-1.1/mels/LJ041-0130.pt|Probably his complaint was due to the fact that his discharge was not related to anything he had done while on active duty LJSpeech-1.1/mels/LJ036-0095.pt|but the Commission concluded that this man was not Lee Harvey Oswald, LJSpeech-1.1/mels/LJ030-0244.pt|hitting me on the shoulder, and shouted to all of us in the back seat to get down. LJSpeech-1.1/mels/LJ021-0184.pt|Great Britain in many ways has advanced further along lines of social security than the United States? LJSpeech-1.1/mels/LJ032-0247.pt|during the summer of nineteen sixty-three. LJSpeech-1.1/mels/LJ017-0022.pt|was that of Eliza Fenning, who was convicted of an attempt to poison a whole family LJSpeech-1.1/mels/LJ010-0141.pt|he was generally supposed to be a surgeon. LJSpeech-1.1/mels/LJ036-0042.pt|However, McWatters' recollection alone was too vague to be a basis for placing Oswald on the bus. LJSpeech-1.1/mels/LJ018-0281.pt|Their operations were no less worldwide. LJSpeech-1.1/mels/LJ044-0057.pt|extensive investigation was not able to connect Oswald with that address, although it did develop the fact LJSpeech-1.1/mels/LJ044-0033.pt|It is also evidence of Oswald's reluctance to describe events accurately LJSpeech-1.1/mels/LJ046-0210.pt|to relate principally to overt threats to harm the President or other specific manifestations of hostility. LJSpeech-1.1/mels/LJ024-0072.pt|a new and younger judge shall be added to the court automatically. LJSpeech-1.1/mels/LJ007-0107.pt|A resolution at once passed the House without division to commit the whole to Newgate, where they remained for various terms. LJSpeech-1.1/mels/LJ050-0191.pt|More importantly, the lack of carefully prepared and carefully transmitted instructions for typical visits to cities LJSpeech-1.1/mels/LJ020-0051.pt|Flour a rolling-pin and roll the dough into a sheet not more than half an inch thick. LJSpeech-1.1/mels/LJ016-0074.pt|The success, although very short-lived, which attended him, no doubt inspired other inmates of Newgate to follow his example. LJSpeech-1.1/mels/LJ031-0221.pt|When put together, these fragments accounted for approximately three-quarters of the missing portion of the skull. LJSpeech-1.1/mels/LJ015-0205.pt|who had been concerned in various "jobs" of a dishonest character, and who for the moment was a clerk in a betting office. LJSpeech-1.1/mels/LJ001-0104.pt|Italy is contentedly stagnant. LJSpeech-1.1/mels/LJ001-0157.pt|of this it may be said that though there is some good paper made now, LJSpeech-1.1/mels/LJ047-0192.pt|On November eighteen the FBI learned that Oswald recently had been in communication with the Soviet Embassy in Washington LJSpeech-1.1/mels/LJ001-0006.pt|And it is worth mention in passing that, as an example of fine typography, LJSpeech-1.1/mels/LJ048-0100.pt|who had just completed advance work on the President's trip to Tampa. LJSpeech-1.1/mels/LJ012-0004.pt|Inquiries set on foot also elicited the suspicion that the person who had represented Mrs. Canning's brother LJSpeech-1.1/mels/LJ008-0086.pt|A great concourse of people attended on this melancholy occasion. LJSpeech-1.1/mels/LJ023-0061.pt|that they were all the powers needed to meet each and every problem which then had a national character LJSpeech-1.1/mels/LJ012-0255.pt|These were the missing members of the same mutilated trunk, LJSpeech-1.1/mels/LJ018-0112.pt|It was one of these, Glendinning, who had allowed himself to be utilized for some time in this way, whose capture led to the breaking up of the gang. LJSpeech-1.1/mels/LJ049-0052.pt|In response to inquiry by the Commission regarding the instructions to agents in a motorcade LJSpeech-1.1/mels/LJ030-0026.pt|Governor and Mrs. Connally and Senator Ralph W. Yarborough had come with the President from Fort Worth. LJSpeech-1.1/mels/LJ037-0085.pt|She was not sure whether she had seen his picture in a newspaper on the afternoon or evening of November twenty-two prior to the lineup. LJSpeech-1.1/mels/LJ014-0092.pt|The hole must have been excavated and the quicklime purchased quite three weeks before O'Connor met his death, LJSpeech-1.1/mels/LJ050-0014.pt|The incumbent has no technical qualifications in the area of Presidential protection. LJSpeech-1.1/mels/LJ040-0203.pt|but essentially a, quote, defensive, rigid, self-involved person LJSpeech-1.1/mels/LJ033-0026.pt|There was little conversation between them on the way home. LJSpeech-1.1/mels/LJ043-0084.pt|business suit, alert replies -- Expresses self extremely well, end quote. LJSpeech-1.1/mels/LJ022-0200.pt|renewed faith in the vast possibilities of human beings to improve their material and spiritual status LJSpeech-1.1/mels/LJ008-0030.pt|The first affair of the kind on this spot was on the third December, seventeen eighty-three, LJSpeech-1.1/mels/LJ044-0199.pt|In retrospect his attempt to go to Cuba or return to the Soviet Union may well have been Oswald's last escape hatch, LJSpeech-1.1/mels/LJ029-0046.pt|Preventive Intelligence Activities. The Protective Research Section (PRS) of the Secret Service LJSpeech-1.1/mels/LJ002-0048.pt|two. The female debtors' side consisted of a court-yard forty-nine by sixteen feet, LJSpeech-1.1/mels/LJ029-0026.pt|it was agreed that the planning of events in Texas would be left largely to the Governor. LJSpeech-1.1/mels/LJ050-0068.pt|According to Chief Rowley, by mid-June nineteen sixty-four, LJSpeech-1.1/mels/LJ012-0171.pt|Every door had been closed against him, every hope of future support blasted. LJSpeech-1.1/mels/LJ042-0245.pt|While Marina Oswald tried to obtain permission to return to the Soviet Union, she testified that she did so at her husband's insistence. LJSpeech-1.1/mels/LJ028-0353.pt|Darius, as the story goes, would often say that "he had rather Zopyrus were unmaimed, than be master of twenty more Babylons." LJSpeech-1.1/mels/LJ006-0199.pt|the most popular being the "Times," "Morning Herald," and "Morning Chronicle"; on Sunday the "Weekly Dispatch," "Bell's Life," and the "Weekly Messenger." LJSpeech-1.1/mels/LJ005-0209.pt|through the bars of which quills or reeds were inserted, and drink conveyed to the prisoners. LJSpeech-1.1/mels/LJ005-0136.pt|The want of sleeping cells long continued a crying need. LJSpeech-1.1/mels/LJ003-0179.pt|which will deal with Mrs. Fry's philanthropic exertions at this period in this particular part of the prison. LJSpeech-1.1/mels/LJ034-0004.pt|Lee Harvey Oswald was hired on October fifteen, nineteen sixty-three, by the Texas School Book Depository as an "order filler." LJSpeech-1.1/mels/LJ028-0182.pt|and in five fifty-five Nabonidus, the father of the Biblical Belshazzar, came to the throne. LJSpeech-1.1/mels/LJ035-0007.pt|The encounter in the lunchroom. LJSpeech-1.1/mels/LJ027-0131.pt|of descent discovered in the development of plant and animal embryos. LJSpeech-1.1/mels/LJ013-0227.pt|The order was, however, at length obeyed, and the whole of the prisoner's clothes were minutely searched. LJSpeech-1.1/mels/LJ039-0179.pt|stated that there was a shorter interval between shots two and three than between shots one and two. LJSpeech-1.1/mels/LJ010-0057.pt|are by this time actually, and by more legitimate efforts, engrafted upon our Constitution. LJSpeech-1.1/mels/LJ040-0115.pt|Pic and his wife would have been happy to have kept Lee, however, LJSpeech-1.1/mels/LJ023-0006.pt|Tonight, sitting at my desk in the White House, I make my first radio report to the people in my second term of office. LJSpeech-1.1/mels/LJ033-0148.pt|Using a standard chemical method involving silver nitrates LJSpeech-1.1/mels/LJ016-0262.pt|It was a callous, careless crowd of coarse-minded, semi-brutalized folk, who came to enjoy themselves. LJSpeech-1.1/mels/LJ011-0258.pt|The defense he set up was, that Mullay had used epithets towards him while they were negotiating a business matter, LJSpeech-1.1/mels/LJ013-0050.pt|But among the charges on the estate he left LJSpeech-1.1/mels/LJ002-0149.pt|The latter indeed hung like millstones round the neck of the unhappy insolvent wretches who found themselves in limbo. LJSpeech-1.1/mels/LJ016-0416.pt|Many, like Wainwright, were calm and imperturbable throughout their trying ordeal. LJSpeech-1.1/mels/LJ040-0111.pt|with no behavior or truancy problems. LJSpeech-1.1/mels/LJ012-0045.pt|he put another lady, with whom he was on intimate terms. LJSpeech-1.1/mels/LJ038-0234.pt|Although Oswald destroyed the notebook, three photographs found among Oswald's possessions after the assassination LJSpeech-1.1/mels/LJ002-0134.pt|The County Court was the sheriff's, who sat there surrounded by the bishop and the magnates of the county; LJSpeech-1.1/mels/LJ038-0247.pt|A fourth photograph, showing a stretch of railroad tracks, LJSpeech-1.1/mels/LJ004-0001.pt|The Chronicles of Newgate, Volume two. By Arthur Griffiths. Section seven: The beginnings of prison reform. LJSpeech-1.1/mels/LJ038-0132.pt|When asked why he lived at his roominghouse under the name O. H. Lee, LJSpeech-1.1/mels/LJ042-0240.pt|he continued to be interested in that country after he returned to the United States. LJSpeech-1.1/mels/LJ034-0100.pt|this man I saw previously was aiming for his last shot. As it appeared to me he was standing up and resting against the left window sill, end quote. LJSpeech-1.1/mels/LJ014-0228.pt|generally known by the soubriquet of "General Haynau," a name execrated in England about this time. LJSpeech-1.1/mels/LJ018-0103.pt|and silver coins, with all the latest appliances for coining, including those of electroplating; LJSpeech-1.1/mels/LJ038-0217.pt|indicated that the note was written when they were living in a rented apartment; therefore it could not have been written while Marina Oswald was living with the Paines. LJSpeech-1.1/mels/LJ050-0222.pt|would take approximately twenty months to implement and require expenditures of approximately three million dollars during that period. LJSpeech-1.1/mels/LJ001-0050.pt|and though the famous family of Aldus restored its technical excellence, rejecting battered letters, LJSpeech-1.1/mels/LJ010-0170.pt|His acquaintances often asked his object in this, but he kept his own counsel till the tenth June. LJSpeech-1.1/mels/LJ028-0284.pt|When he found that Darius did indeed value it highly, he considered further with himself how he might make the deed his own, and be the man to take Babylon. LJSpeech-1.1/mels/LJ019-0351.pt|Nor were these the only inducements offered. Where local authorities were indisposed to set their prisons in order, LJSpeech-1.1/mels/LJ030-0218.pt|the right rear tail, when she noticed that I was trying to climb on the car. LJSpeech-1.1/mels/LJ012-0030.pt|Thus, a watch was paid for as a watch, whether it was of gold or silver; a piece of linen as such, whether the stuff was coarse or fine. LJSpeech-1.1/mels/LJ042-0244.pt|Oswald subsequently did subscribe to several Soviet journals. LJSpeech-1.1/mels/LJ035-0043.pt|Yet he must have entered the vestibule door before Truly reached the top of the stairwell, since Truly did not see him. LJSpeech-1.1/mels/LJ018-0068.pt|Inspector Thain, who, being unable to obtain his extradition legally, had him inveigled on board an English steamer, LJSpeech-1.1/mels/LJ023-0091.pt|I have not the time to quote to you all the language used by dissenting justices in many of these cases. LJSpeech-1.1/mels/LJ022-0005.pt|It has made and is making distinct progress. LJSpeech-1.1/mels/LJ028-0178.pt|the walls of Babylon were so long and wide and high that all who saw them were amazed. LJSpeech-1.1/mels/LJ050-0193.pt|Such instructions will not fit all circumstances, of course, LJSpeech-1.1/mels/LJ029-0212.pt|"Welcome Mr. Kennedy to Dallas," sponsored by the American Fact-finding Committee, which the sponsor later testified was an ad hoc committee LJSpeech-1.1/mels/LJ019-0063.pt|who maintained that under this system prisoners were more industrious and more healthy LJSpeech-1.1/mels/LJ019-0126.pt|The creation of an expensive staff for supervision, LJSpeech-1.1/mels/LJ045-0237.pt|His denials under questioning, which have no probative value in view of the many readily demonstrable lies he told at that time LJSpeech-1.1/mels/LJ042-0007.pt|At the age of nineteen, Oswald thus committed an act which was the most striking indication he had yet given LJSpeech-1.1/mels/LJ047-0143.pt|The possible contact with the Soviet Embassy in Mexico intensified the FBI's interest in learning Oswald's whereabouts. LJSpeech-1.1/mels/LJ049-0176.pt|On the other hand, the Secret Service had no knowledge whatever of Oswald, his background, or his employment at the Book Depository, LJSpeech-1.1/mels/LJ050-0232.pt|to assist in its protection functions. LJSpeech-1.1/mels/LJ008-0017.pt|and when he evaded the sentence by suicide, his body was exhibited in the same neighborhood, LJSpeech-1.1/mels/LJ042-0072.pt|Still intent, however, on staying in the Soviet Union, LJSpeech-1.1/mels/LJ010-0245.pt|one of the equerries. The Queen was untouched, and at first, it is said, hardly realized the danger she had escaped. LJSpeech-1.1/mels/LJ006-0260.pt|From the same source came the two or three strong files which the inspectors found in one ward, LJSpeech-1.1/mels/LJ027-0165.pt|Now, the lower forms of amphibians, such as siredon, menobranchus, siren, etc., LJSpeech-1.1/mels/LJ033-0192.pt|When Paul M. Stombaugh of the FBI Laboratory examined the paper bag, LJSpeech-1.1/mels/LJ018-0117.pt|Wagner, after conviction, offered to reveal, for a reward of three thousand pounds LJSpeech-1.1/mels/LJ003-0271.pt|Some of the worst and most extensive burglaries were planned there. LJSpeech-1.1/mels/LJ008-0068.pt|But the fall apart and inwards of two leaves is considered superior. LJSpeech-1.1/mels/LJ018-0152.pt|With her assistance on a certain day a couple of bricks were taken out of the wall dividing her front and back parlors; LJSpeech-1.1/mels/LJ019-0396.pt|At a short distance stood another prison of detention, that of Clerkenwell, LJSpeech-1.1/mels/LJ016-0338.pt|inside the jail was Colonel Frazer, the chief commissioner of the city police, and at no great distance, although in the background, LJSpeech-1.1/mels/LJ021-0089.pt|and have effected a reorganization of the N.R.A. LJSpeech-1.1/mels/LJ044-0230.pt|His unhappy experience with the Cuban consul seems thus to have reduced his enthusiasm for the Castro regime and his desire to go to Cuba. LJSpeech-1.1/mels/LJ018-0133.pt|which gave him access to all parts of the mills, the packing-room included. LJSpeech-1.1/mels/LJ039-0190.pt|Simmons testified that familiarity with the bolt could be achieved in dry practice and, as has been indicated above, LJSpeech-1.1/mels/LJ050-0250.pt|The Secret Service will be better able to plan its own long-range personnel requirements if it knows with reasonable certainty LJSpeech-1.1/mels/LJ040-0168.pt|She thought that he had detached himself from the world around him because, quote, no one in it ever met any of his needs for love, end quote. LJSpeech-1.1/mels/LJ010-0097.pt|Here they were surprised by the police, headed by a magistrate, and supported by a strong detachment of Her Majesty's Guards. LJSpeech-1.1/mels/LJ040-0064.pt|This occurred two months before Lee was born in New Orleans on October eighteen, nineteen thirty-nine. LJSpeech-1.1/mels/LJ050-0199.pt|The Commission strongly encourages these efforts to improve protection along a motorcade route. LJSpeech-1.1/mels/LJ028-0322.pt|Thus did Zopyrus speak. LJSpeech-1.1/mels/LJ008-0208.pt|Some years later an eye-witness published a graphic account of one of these scenes. LJSpeech-1.1/mels/LJ027-0023.pt|that the only reasonable explanation for the existence of a fundamental unity in organic life LJSpeech-1.1/mels/LJ012-0170.pt|According to his statement, when sentenced to death, he had been driven to horse-stealing by the execration which had pursued him after the murder. LJSpeech-1.1/mels/LJ003-0242.pt|was still practiced, that of loading newly-arrived prisoners until they paid certain fees. LJSpeech-1.1/mels/LJ007-0213.pt|Again the following year the inspectors repeat their charge. LJSpeech-1.1/mels/LJ014-0108.pt|It was soon ascertained that the wife had gone off in a cab with a quantity of luggage. LJSpeech-1.1/mels/LJ035-0151.pt|He was walking into the office from the back hallway, LJSpeech-1.1/mels/LJ010-0253.pt|The enthusiasm of the people at the Queen's escape was uproarious, and her drive next day was one long triumphal progress. LJSpeech-1.1/mels/LJ001-0116.pt|still clings to a foolish, because misunderstood conventionality, deduced from what was once ornament, and is by no means useful; LJSpeech-1.1/mels/LJ041-0203.pt|to engage in activities on behalf of the Fair Play for Cuba Committee in the summer of nineteen sixty-three, LJSpeech-1.1/mels/LJ030-0195.pt|Observing his blood-covered chest as he was pulled into his wife's lap, Governor Connally believed himself mortally wounded. LJSpeech-1.1/mels/LJ045-0119.pt|which had led to the disclosure of his defection in New Orleans. LJSpeech-1.1/mels/LJ019-0359.pt|He could in the first place withhold the government grant in aid of prison funds by refusing the certificate to the Treasury upon which the allowance was paid. LJSpeech-1.1/mels/LJ001-0174.pt|should be a part of the whole scheme of the book. LJSpeech-1.1/mels/LJ037-0148.pt|in Oswald's possession to the exclusion of all other weapons. LJSpeech-1.1/mels/LJ009-0260.pt|The spectacle was horrible; LJSpeech-1.1/mels/LJ028-0152.pt|In the circuit of the wall are a hundred gates, all of brass, with brazen lintels and sideposts. LJSpeech-1.1/mels/LJ031-0108.pt|Rubber tubes were inserted between the second and third ribs to reexpand the right lung, which had collapsed because of the opening in the chest wall. LJSpeech-1.1/mels/LJ005-0298.pt|to the county jails from such prisons as were past improvement, and that the borough funds should be charged for the accommodation. LJSpeech-1.1/mels/LJ020-0087.pt|One word with regard to getting up early in order to give dough a chance for the second rising. LJSpeech-1.1/mels/LJ005-0069.pt|Absence of embellishment is in perfect unison with the character of the establishment. LJSpeech-1.1/mels/LJ003-0328.pt|Had they been accepted in their entirety, little fault could in future have been found with the managers of Newgate. LJSpeech-1.1/mels/LJ007-0008.pt|their especial care. LJSpeech-1.1/mels/LJ048-0134.pt|would be a desirable innovation. LJSpeech-1.1/mels/LJ046-0134.pt|In the period from November nineteen sixty-one to November nineteen sixty-three, LJSpeech-1.1/mels/LJ008-0016.pt|Lawrence Jones, a burglar, was in seventeen ninety-three ordered for execution in Hatton Garden, near the house he had robbed; LJSpeech-1.1/mels/LJ019-0277.pt|the prisoners should be made to dispense with the use of a mattress, and should sleep on planks. LJSpeech-1.1/mels/LJ012-0133.pt|The fraudulent messenger, by the help of young Caspar, established his claim to the boxes, paid the wharfage dues, and carried off the gold-dust. LJSpeech-1.1/mels/LJ028-0086.pt|the lips are thin, the chin prominent; the neck is that of a strong vigorous man. LJSpeech-1.1/mels/LJ047-0204.pt|Bouck pointed to a number of characteristics besides Oswald's defection the cumulative effect of which would have been to alert the Secret Service LJSpeech-1.1/mels/LJ019-0106.pt|His plan was to devote the whole labor of prisoners sentenced to any term between three months and four years to agriculture. LJSpeech-1.1/mels/LJ040-0120.pt|Lee refused to discuss the matter with Pic, whom he had previously idolized, and their relations were strained thereafter. LJSpeech-1.1/mels/LJ025-0058.pt|but the fact, important as it was, fell into oblivion and had to be rediscovered by Treviranus in eighteen oh seven. LJSpeech-1.1/mels/LJ035-0118.pt|They rushed to the west windows after the shots were fired and remained there LJSpeech-1.1/mels/LJ009-0129.pt|that many of the kneeling men or boys laughed while they knelt, pinched each other, and, when they could do so without fear of being seen by any officer of the prison, LJSpeech-1.1/mels/LJ019-0340.pt|The latter was rendered nearly impossible by the penalties imposed on persons bringing spirituous liquors into the jail. LJSpeech-1.1/mels/LJ048-0223.pt|After the President had retired at his hotel, LJSpeech-1.1/mels/LJ019-0325.pt|the ministrations of ministers of their own form of belief. LJSpeech-1.1/mels/LJ035-0098.pt|he was certain that both elevators, which occupy the same shaft, were on the fifth floor. LJSpeech-1.1/mels/LJ016-0325.pt|The judge of the Admiralty Court, the Right Hon. Stephen Lushington, the Right Hon. James Moncrieff, LJSpeech-1.1/mels/LJ034-0216.pt|In the background of this picture were several employees watching the parade from the steps of the Depository Building. LJSpeech-1.1/mels/LJ017-0101.pt|That day Palmer had bought more strychnia, and had called in a fresh doctor. LJSpeech-1.1/mels/LJ022-0099.pt|to move as rapidly as possible back into private employment when such employment is available. LJSpeech-1.1/mels/LJ033-0115.pt|I remember that I didn't look at the package very much but when I did look at it he did have his hands on the package like that, end quote, and at this point LJSpeech-1.1/mels/LJ049-0072.pt|those in command should be able to direct the response appropriate to the emergency. The Commission finds that the Secret Service agents in the motorcade LJSpeech-1.1/mels/LJ021-0100.pt|Let me call your attention to the fact that the national Industrial Recovery Act LJSpeech-1.1/mels/LJ016-0156.pt|at no elevation affords the only drop, strangulation would seldom supervene but for the resolution of the miserable felo de se. LJSpeech-1.1/mels/LJ010-0291.pt|Pate was found guilty, and sentenced to seven years' transportation, the judge, Baron Alderson, abstaining from inflicting the penalty of whipping, LJSpeech-1.1/mels/LJ037-0172.pt|even though only four bullets were recovered. LJSpeech-1.1/mels/LJ044-0229.pt|and had lost his desire to do so because of the bureaucracy and red tape which he had encountered. LJSpeech-1.1/mels/LJ049-0217.pt|Moreover, a number of imponderable questions have to be weighed if any change in the intimate association now established LJSpeech-1.1/mels/LJ039-0194.pt|All three of the firers in these tests LJSpeech-1.1/mels/LJ003-0256.pt|By this means spirits, otherwise unattainable and strictly prohibited, were smuggled into the jail. LJSpeech-1.1/mels/LJ050-0171.pt|but it seems to warrant further study before each agency becomes irrevocably committed to separate action. LJSpeech-1.1/mels/LJ050-0151.pt|it makes no use of the recent developments in automatic data processing which are widely used in the business world and in other Government offices. LJSpeech-1.1/mels/LJ017-0211.pt|which left London for Singapore on the twenty-eighth July, eighteen sixty-three, with a cargo of wine and other goods. LJSpeech-1.1/mels/LJ003-0181.pt|There was a master's side for females who could pay the usual fees, but they associated with the rest in the one narrow yard common to all. LJSpeech-1.1/mels/LJ035-0051.pt|He saw a man walking away from him in the lunchroom. LJSpeech-1.1/mels/LJ022-0187.pt|but these twenty years have shown by experience definite possibilities for improvement. LJSpeech-1.1/mels/LJ013-0204.pt|he admitted that he had been justly convicted, and expressed great anxiety that his fellow-servants should be relieved from all suspicion. LJSpeech-1.1/mels/LJ039-0113.pt|as a, quote, rather poor shot, end quote. LJSpeech-1.1/mels/LJ014-0032.pt|as the seducer of an innocent girl to whom he (Hocker) had been fondly attached. LJSpeech-1.1/mels/LJ045-0154.pt|Answer: He said that he was lonely because he hadn't come the preceding weekend, and he wanted to make his peace with me. LJSpeech-1.1/mels/LJ013-0206.pt|Next morning he made a full confession in presence of his attorney, and the governor, Mr. Cope. LJSpeech-1.1/mels/LJ021-0205.pt|I believe with Abraham Lincoln, that "The legitimate object of government is to do for a community of people LJSpeech-1.1/mels/LJ003-0260.pt|Another frightful consequence of this indiscriminate admission was the influx of numbers of abandoned women, LJSpeech-1.1/mels/LJ030-0044.pt|Motorcycles. -- Next came four to six motorcycle policemen whose main purpose was to keep the crowd back. LJSpeech-1.1/mels/LJ034-0143.pt|but he said he was unable to make a positive identification. LJSpeech-1.1/mels/LJ033-0150.pt|Sebastian F. Latona, supervisor of the FBI's Latent Fingerprint Section, LJSpeech-1.1/mels/LJ012-0144.pt|and passed it on to Solomons by his daughter, a widow named Abrahams. LJSpeech-1.1/mels/LJ004-0094.pt|This act set forth that "whereas the malignant fever commonly called the jail distemper LJSpeech-1.1/mels/LJ015-0113.pt|followed him over to Sweden, and arrested him at Helsingfors. LJSpeech-1.1/mels/LJ047-0179.pt|Hosty did nothing further in connection with the Oswald case until after the assassination. On November one, nineteen sixty-three, LJSpeech-1.1/mels/LJ010-0292.pt|which was authorized by a recent act, on account of Mr. Pate's family and position in life. LJSpeech-1.1/mels/LJ013-0187.pt|near it was his Waterloo medal, and the above-mentioned ten-pound note. LJSpeech-1.1/mels/LJ049-0216.pt|the FBI, the CIA, and the military intelligence agencies as well as the Secret Service. LJSpeech-1.1/mels/LJ006-0248.pt|Matters were at times still worse, and the rioting went on to such dangerous lengths as to endanger the safety of the building. LJSpeech-1.1/mels/LJ031-0087.pt|When asked why he did not turn the President over, Dr. Carrico testified as follows: LJSpeech-1.1/mels/LJ004-0201.pt|At Ilchester the rule of employment had been carried further. LJSpeech-1.1/mels/LJ025-0092.pt|It is now established that nitrogen is as essential a constituent of vegetable as of animal living matter LJSpeech-1.1/mels/LJ016-0170.pt|greater attention was paid to the capital convicts, and the horrors of their situation while awaiting sentence LJSpeech-1.1/mels/LJ007-0243.pt|It was not till the erection of the new prison at Holloway in eighteen fifty, and the entire internal reconstruction of Newgate according to new ideas, LJSpeech-1.1/mels/LJ050-0166.pt|The Commission was struck by the apparent lack of effort, on an interagency basis, LJSpeech-1.1/mels/LJ040-0209.pt|well I've got to live with her. I guess I love her, end quote. LJSpeech-1.1/mels/LJ002-0075.pt|and who are therefore lodged apart from all other districts of the jail. End quote. LJSpeech-1.1/mels/LJ016-0213.pt|The origin of this expression dates, it is said, from the time when the Scottish mark, LJSpeech-1.1/mels/LJ001-0146.pt|which requires the constant exercise of judgment and taste on the part of the printer. LJSpeech-1.1/mels/LJ027-0040.pt|between the fin of a fish and the paddle of a whale LJSpeech-1.1/mels/LJ029-0097.pt|and on their return to Dallas drove over the route which Sorrels believed best suited for the proposed motorcade. LJSpeech-1.1/mels/LJ022-0104.pt|and the experience and the competence necessary to carry on the two hundred and fifty or three hundred kinds of work that will be undertaken. LJSpeech-1.1/mels/LJ005-0031.pt|no visiting of friends, no education but religious education, no freedom of diet, LJSpeech-1.1/mels/LJ032-0233.pt|reinforce the belief that the rifle in the photograph is the rifle which Oswald bought from Klein's. LJSpeech-1.1/mels/LJ028-0429.pt|The excavations have shown that Babylon, as the ancients told us, was nearly square. LJSpeech-1.1/mels/LJ049-0032.pt|had no special design or equipment which would have permitted the Secret Service agent riding in the driver's compartment LJSpeech-1.1/mels/LJ025-0139.pt|converge toward the conclusion that the nerve fibers, which have been regarded as ultimate elements of nervous tissue, LJSpeech-1.1/mels/LJ011-0037.pt|Appeals were made to the Home Secretary, and all possible political interest brought to bear, but without success. LJSpeech-1.1/mels/LJ002-0151.pt|Neild found at his visit to Newgate in eighteen ten, LJSpeech-1.1/mels/LJ044-0181.pt|The Cubans would not, however, give him a visa until he had received one from the Soviets, which involved a delay of several months. LJSpeech-1.1/mels/LJ033-0132.pt|I didn't pay too much attention the way he was walking because I was walking along there looking at the railroad cars and watching the men on the diesel switch them cars LJSpeech-1.1/mels/LJ036-0040.pt|In a later interview, Jones confirmed that he had exchanged words with a woman passenger on the bus during the ride south on Marsalis. LJSpeech-1.1/mels/LJ039-0195.pt|were able to fire the rounds within the time period which would have been available to the assassin under those conditions. LJSpeech-1.1/mels/LJ003-0298.pt|for giving every prisoner a sleeping cell to himself, an amount of enlightenment which is hardly general among European nations at this LJSpeech-1.1/mels/LJ047-0149.pt|the New Orleans office of the FBI learned that in September Oswald had given a forwarding address of two five one five LJSpeech-1.1/mels/LJ033-0083.pt|Oswald gripped the bag in his right hand near the top, quote, It tapered like this as he hugged it in his hand. LJSpeech-1.1/mels/LJ049-0138.pt|and, if the Council is used, arrangements should be made for the attendance of the Secretary of the Treasury LJSpeech-1.1/mels/LJ023-0141.pt|can, if they choose, hold office for life, no matter how old they may get to be. LJSpeech-1.1/mels/LJ015-0044.pt|with money enough to retrieve the position of the bank. But that passed from bad to worse; LJSpeech-1.1/mels/LJ021-0111.pt|There may be a serious question as to the wisdom of many of those devices to control production, LJSpeech-1.1/mels/LJ002-0097.pt|they had dust-bins, sewers, and so forth, "properly disposed," and the city scavenger paid periodical visits to the prison. LJSpeech-1.1/mels/LJ012-0085.pt|The chest was opened to give change, and a heavy tray lifted out which plainly held some four thousand pounds in cash. LJSpeech-1.1/mels/LJ018-0179.pt|On his return to Newgate to be finally discharged, Cummings jumped up the stairs and fairly danced for joy. LJSpeech-1.1/mels/LJ016-0402.pt|No woman could resist him, he calmly assured Mr. Smith that night as they walked together, and he recounted his villanies one by one. LJSpeech-1.1/mels/LJ037-0082.pt|On the evening of November twenty-two, LJSpeech-1.1/mels/LJ010-0114.pt|His sudden access to means unlimited was no doubt due to the profitable role he soon adopted of Government informer and spy, LJSpeech-1.1/mels/LJ019-0068.pt|Separation was injurious to health, mental or physical, said one side; men broke down when subjected to it for more than a certain period, LJSpeech-1.1/mels/LJ045-0037.pt|after his recent rebuffs in Mexico City LJSpeech-1.1/mels/LJ004-0205.pt|Industrial labor had also been introduced with satisfactory results. LJSpeech-1.1/mels/LJ035-0027.pt|They went through the swinging door and continued at, quote, a good trot, end quote, LJSpeech-1.1/mels/LJ034-0121.pt|twenty-seven, five foot eleven, one hundred sixty-five pounds, black wavy hair, end quote, LJSpeech-1.1/mels/LJ001-0047.pt|Of Jenson it must be said that he carried the development of Roman type as far as it can go: LJSpeech-1.1/mels/LJ019-0176.pt|The wards had open fires, but the separate cells were not warmed at all. LJSpeech-1.1/mels/LJ020-0061.pt|Break the rolls apart from one another and eat warm. They are also good cold, and if the directions be followed implicitly, very good always. LJSpeech-1.1/mels/LJ033-0095.pt|Frazier testified that Oswald carried no lunch bag that day. LJSpeech-1.1/mels/LJ028-0195.pt|It is a long story. Poets have sung it. Historians have written it. Prophets have preached it. Legends have gathered about it. LJSpeech-1.1/mels/LJ011-0288.pt|Thus free, he eluded the vigilance of two of the party, who were at dinner in the front kitchen, LJSpeech-1.1/mels/LJ009-0045.pt|he steps boldly with head upright, looks to the women's gallery, and smiles. His intention is to pass for a brave fellow, LJSpeech-1.1/mels/LJ027-0064.pt|All vertebrates, and none other, have two cavities, LJSpeech-1.1/mels/LJ037-0218.pt|Marina Oswald testified that this was the holster which contained the revolver in the photographs taken on Neely Street. LJSpeech-1.1/mels/LJ049-0048.pt|and therefore approximately one point six seconds after the President was shot in the head. LJSpeech-1.1/mels/LJ050-0156.pt|this money would be used to compensate consultants, to lease standard equipment or to purchase specially designed pilot equipment. LJSpeech-1.1/mels/LJ006-0222.pt|and enlivened by flash songs and thrilling long-winded descriptions of robberies and other "plants." LJSpeech-1.1/mels/LJ018-0086.pt|His demeanor immediately preceding his execution I have referred to in the last chapter. LJSpeech-1.1/mels/LJ044-0236.pt|it is unlikely that a reasoning person would plan to attempt to travel from Dallas, Texas to Cuba LJSpeech-1.1/mels/LJ028-0355.pt|he gave him likewise the government of Babylon for his life, free from tribute, and he also granted him many other favors. LJSpeech-1.1/mels/LJ031-0198.pt|Upon arrival, President Johnson made a brief statement over television and radio. LJSpeech-1.1/mels/LJ027-0105.pt|a number of organs which never could have been of use to any kind of creature save a terrestrial quadruped. LJSpeech-1.1/mels/LJ038-0238.pt|An examination of the window at the rear of the house, the wall through which the bullet passed, and the fence behind the house LJSpeech-1.1/mels/LJ014-0058.pt|These great criminals suffered at Horsemonger Lane Jail, but they were tried at the Central Criminal Court, and were for some time inmates of Newgate. LJSpeech-1.1/mels/LJ018-0303.pt|a second conspirator exchanged the gold for notes. But just as all promised well, the frauds were detected through the carelessness of the forgers. LJSpeech-1.1/mels/LJ030-0240.pt|to that effect immediately after the assassination. LJSpeech-1.1/mels/LJ003-0066.pt|As many various and, according to our ideas, heinous crimes came under this head, LJSpeech-1.1/mels/LJ015-0035.pt|produced immediate embarrassment and financial distress. LJSpeech-1.1/mels/LJ032-0230.pt|that the published pictures were the same as the original except for retouching done by these publications, apparently for the purpose of clarifying the lines of the rifle LJSpeech-1.1/mels/LJ007-0239.pt|both offenses and punishments affording a sufficient index to the practices going forward; and they wind up by declaring LJSpeech-1.1/mels/LJ002-0310.pt|that debtors who could afford the cabin and master's side were not permitted to share in the prison charities. LJSpeech-1.1/mels/LJ033-0036.pt|No curtain rods were known to have been discovered in the Depository Building after the assassination. LJSpeech-1.1/mels/LJ002-0235.pt|were places set apart for skittles, fives, and tennis, which strangers frequented as any other place of public amusement. LJSpeech-1.1/mels/LJ038-0295.pt|An official of this church told FBI agents that services are held every Wednesday at the church except during the month of August. LJSpeech-1.1/mels/LJ014-0045.pt|that Delarue had suffered by the hands of imaginary outraged brothers acting as the avengers of females deeply injured by him. LJSpeech-1.1/mels/LJ021-0036.pt|loans to the railroads and insurance companies and, finally, help for home owners and industry itself. LJSpeech-1.1/mels/LJ004-0039.pt|They were hopeless of any general reform by the action of the executive alone. LJSpeech-1.1/mels/LJ017-0011.pt|But secret poisoning on a wholesale scale such as was practiced in Italy and France was happily never popularized in England. LJSpeech-1.1/mels/LJ008-0037.pt|were brought out of Newgate about eight in the morning, and suspended on a gallows of a new construction. LJSpeech-1.1/mels/LJ027-0034.pt|Hence, as Jordan has said, "the inside of an animal tells the real history of its ancestry; the outside tells us only where its ancestors have been." LJSpeech-1.1/mels/LJ011-0066.pt|The concourse in front of Newgate was enormous, but much sympathy was evinced for this unfortunate victim to human weakness and ruthless laws. LJSpeech-1.1/mels/LJ046-0159.pt|accumulated over a twenty-year period, some of which included more than one individual. LJSpeech-1.1/mels/LJ027-0079.pt|a series of either fore or hind limbs of a mammal with one toe (horse), LJSpeech-1.1/mels/LJ019-0247.pt|which existed in the various prisons, LJSpeech-1.1/mels/LJ034-0059.pt|Since other identifiable prints were developed on the cartons, the Commission requested that they be compared with the prints of the twelve warehouse employees LJSpeech-1.1/mels/LJ001-0106.pt|oddity rather than rational beauty and meaning being apparently the thing sought for both in the letters and the illustrations. LJSpeech-1.1/mels/LJ019-0158.pt|Later on a more efficacious but still imperfect method of supervision was introduced. Iron cages, which are still to be seen in Newgate, LJSpeech-1.1/mels/LJ040-0079.pt|John Pic testified that he thought Lee found in Ekdahl the father that he never had. LJSpeech-1.1/mels/LJ019-0309.pt|The main object of this act was to compass that uniformity in discipline and treatment generally LJSpeech-1.1/mels/LJ017-0271.pt|Lyons asked the time, and was told it was only five. LJSpeech-1.1/mels/LJ037-0015.pt|but he saw the policeman leave the car, heard three or four shots, and then saw the policeman fall. LJSpeech-1.1/mels/LJ029-0109.pt|Representatives of the local host committee and the White House staff were advised by the Secret Service of the actual route on the afternoon of November eighteen. LJSpeech-1.1/mels/LJ021-0006.pt|have had to do with industry and labor and with respect to these, certain developments have taken place which I consider of importance. LJSpeech-1.1/mels/LJ039-0065.pt|so that the President would have been moving in an almost straight line away from the assassin's rifle. LJSpeech-1.1/mels/LJ011-0144.pt|but Mr. Joseph Hume pressed the Government hard, and obtained an assurance that the men should not be executed. LJSpeech-1.1/mels/LJ014-0246.pt|Thus, when a payment was made by the company, the amount disbursed was carried to account in the general books from its entry in the passbook, LJSpeech-1.1/mels/LJ007-0124.pt|The infirmary at this particular period epitomized the condition of the jail at large. LJSpeech-1.1/mels/LJ030-0013.pt|David F. Powers of the President's staff later stated that when the President asked for his assessment of the day's activities, Powers replied LJSpeech-1.1/mels/LJ038-0224.pt|Another statement which limits the time when it could have been written is the reference, quote, you and the baby, end quote, LJSpeech-1.1/mels/LJ033-0213.pt|(three) removed the rifle from the blanket in the Paines' garage on Thursday evening; LJSpeech-1.1/mels/LJ017-0051.pt|covered rather scantily with light sandy hair. LJSpeech-1.1/mels/LJ039-0202.pt|At fifteen yards each man's shots landed within the size of a dime. LJSpeech-1.1/mels/LJ016-0245.pt|Until the time of his death he kept a small shop close to the church in Horncastle. LJSpeech-1.1/mels/LJ026-0145.pt|In the animal carbon dioxide, water and nitrogen compounds are the chief excretions. LJSpeech-1.1/mels/LJ016-0087.pt|Among the escapes still remembered was one in eighteen forty-nine, accomplished by a man who had been employed LJSpeech-1.1/mels/LJ001-0049.pt|After his death in the "fourteen eighties," or at least by fourteen ninety, printing in Venice had declined very much; LJSpeech-1.1/mels/LJ016-0349.pt|that of Alexander Mackay, who murdered his mistress at Norton Folgate by beating her with a rolling-pin and furnace-rake, LJSpeech-1.1/mels/LJ009-0070.pt|The youth's hands tremble as they hold the book upside down. LJSpeech-1.1/mels/LJ047-0079.pt|The New Orleans office investigated and located Oswald, learning his address and former place of employment on August five, nineteen sixty-three. LJSpeech-1.1/mels/LJ012-0185.pt|raised the alarm, and suspicion fell upon the three murderers, who were arrested. LJSpeech-1.1/mels/LJ015-0102.pt|He came back to explain that he had mislaid them. LJSpeech-1.1/mels/LJ046-0110.pt|is the identification and elimination of possible sources of danger to the President before the danger becomes actual. LJSpeech-1.1/mels/LJ012-0205.pt|an avowed "snatcher" and habitué of the Fortune of War, a public-house in Smithfield frequented openly by men of this awful profession. LJSpeech-1.1/mels/LJ048-0035.pt|It was against this background and consistent with the criteria followed by the FBI prior to November twenty-two LJSpeech-1.1/mels/LJ017-0260.pt|Vartos the Turk, and Carlos the Greek. LJSpeech-1.1/mels/LJ029-0204.pt|Two days later, a local Republican leader called for a "civilized nonpartisan" welcome LJSpeech-1.1/mels/LJ010-0264.pt|Later on, however, Dasset was himself seized and interrogated, LJSpeech-1.1/mels/LJ038-0037.pt|Oswald then struck McDonald between the eyes with his left fist; with his right hand he drew a gun from his waist. LJSpeech-1.1/mels/LJ035-0137.pt|About this time Shelley saw Truly and Patrolman Baker go into the building LJSpeech-1.1/mels/LJ016-0344.pt|The ceremony, which was witnessed by only a few officials and representatives of the press, was performed with the utmost decency and decorum. LJSpeech-1.1/mels/LJ014-0229.pt|Mobbs systematically ill-used his wife for a long space of time, and at last cut her throat. LJSpeech-1.1/mels/LJ022-0087.pt|After the Division of Applications and Information has sifted those projects, LJSpeech-1.1/mels/LJ004-0047.pt|One of the moving spirits was the Honorable H. G. Bennet, M.P., whose vigorous protests against the lamentable condition of Newgate have already been recorded. LJSpeech-1.1/mels/LJ048-0147.pt|The Commission believes LJSpeech-1.1/mels/LJ027-0073.pt|may be shown to be modifications one of another. LJSpeech-1.1/mels/LJ030-0082.pt|The agents on the front of the running boards had directions to move immediately to positions just to the rear of the President and Mrs. Kennedy when the President's car slowed LJSpeech-1.1/mels/LJ036-0134.pt|I asked him where he wanted to go. And he said, "five hundred North Beckley. Well, I started up, LJSpeech-1.1/mels/LJ008-0295.pt|When the council had decided, the news was conveyed to Newgate by the Recorder, who made his "report," as it was called. LJSpeech-1.1/mels/LJ038-0153.pt|He said that he left work because Bill Shelley said that there would be no more work done that day in the building. LJSpeech-1.1/mels/LJ012-0126.pt|The next year twelve thousand sovereigns were cleverly stolen in the Mile End Road. LJSpeech-1.1/mels/LJ012-0087.pt|should be introduced into the building, and secreted there during the night to accomplish the robbery. LJSpeech-1.1/mels/LJ008-0141.pt|the doubtfulness of the issue, or the superior position of the perpetrator, LJSpeech-1.1/mels/LJ018-0100.pt|took to appropriating the bills intrusted to him, and so lost his business, after which he became a clerk to Messrs. Wagner and Bateman. LJSpeech-1.1/mels/LJ012-0237.pt|A very painful scene occurred in Newgate when the news of his escape from death was imparted to May. LJSpeech-1.1/mels/LJ031-0168.pt|In another car Mrs. Johnson was driven to the airport accompanied by Secret Service agents and Representative Brooks. LJSpeech-1.1/mels/LJ048-0087.pt|The President's trip to Dallas called into play many standard operating procedures of the Secret Service in addition to its preventive intelligence operations. LJSpeech-1.1/mels/LJ040-0174.pt|Lee confirmed some of those observations by saying that he felt almost as if there were a veil between him and other people LJSpeech-1.1/mels/LJ031-0166.pt|Unmarked police cars took the Vice President and Mrs. Johnson from Parkland Hospital to Love Field. LJSpeech-1.1/mels/LJ014-0301.pt|In eighteen fifty-three a second case of gigantic fraud alarmed and scandalized the financial world. LJSpeech-1.1/mels/LJ019-0086.pt|or they might herd together or communicate freely as in the old worst days. They might see each other when they liked, and converse sotto voce, LJSpeech-1.1/mels/LJ039-0074.pt|you should not have any difficulty in hitting your target. I mean it requires no training at all to shoot a weapon with a telescopic sight LJSpeech-1.1/mels/LJ001-0087.pt|for the seventeenth-century letters are at least pure and simple in line. The Italian, Bodoni, and the Frenchman, Didot, LJSpeech-1.1/mels/LJ004-0054.pt|In order to give greater value to the pamphlet, LJSpeech-1.1/mels/LJ010-0186.pt|There is no occasion to use violence. I will go with you. LJSpeech-1.1/mels/LJ011-0135.pt|Macintosh's amendment was carried in the Commons, but the new law did not pass the Lords, who re-enacted the capital penalty. LJSpeech-1.1/mels/LJ040-0092.pt|when he left school in order to get into the Coast Guard. Since his mother did not approve of his decision to continue school LJSpeech-1.1/mels/LJ010-0285.pt|invariably went out in a cab, for which he always paid the same fare, LJSpeech-1.1/mels/LJ012-0209.pt|and after some haggling they agreed on a price, and in the afternoon the snatchers brought a hamper which contained a body in a sack. LJSpeech-1.1/mels/LJ016-0327.pt|declared that they were not prepared to agree to the resolution respecting private executions. LJSpeech-1.1/mels/LJ028-0477.pt|To protect the sun-dried bricks of the inner wall from the winter rains LJSpeech-1.1/mels/LJ025-0173.pt|The watery solution, in which its roots are plunged, contains nitrogen but no carbon; LJSpeech-1.1/mels/LJ048-0279.pt|They work long, hard hours, under very great strain, and must travel frequently. LJSpeech-1.1/mels/LJ019-0331.pt|Baths were provided, ablutions ordered, and all appliances to insure personal cleanliness. LJSpeech-1.1/mels/LJ019-0300.pt|The committee might well suggest the abolition of these jails, or their amalgamation with the larger county establishments in their immediate neighborhood. LJSpeech-1.1/mels/LJ031-0092.pt|Did you ever have occasion to look at the President's back? LJSpeech-1.1/mels/LJ014-0131.pt|but Mrs. Manning, speaking in a foreign accent, addressed the court with great fluency and vehemence. LJSpeech-1.1/mels/LJ016-0009.pt|He had friends and auxiliaries inside the jail and out. The cell he occupied was near the outer wall, LJSpeech-1.1/mels/LJ039-0181.pt|the shots would have been evenly spaced and the assassin would not have incurred so sharp an angular movement. LJSpeech-1.1/mels/LJ013-0202.pt|Coolness amounting almost to effrontery gave way to hopeless dejection. LJSpeech-1.1/mels/LJ003-0234.pt|The bedding was scanty; fuel and light had to be purchased out of prisoners' private means; clothing was issued but rarely, LJSpeech-1.1/mels/LJ004-0014.pt|filthiness, severity, or neglect; many new dungeons had aggravated the evils against which his sagacity could not but remonstrate; LJSpeech-1.1/mels/LJ018-0188.pt|Presently "Old Bob" drove up to Camberwell Gate in the same cart in which he had been seen to start. LJSpeech-1.1/mels/LJ002-0028.pt|In order to realize the evils entailed by incarceration in Newgate in these days, it is necessary to give some account of its interior LJSpeech-1.1/mels/LJ033-0029.pt|It would appear, however, that obtaining curtain rods was not the purpose of Oswald's trip to Irving on November twenty-one. LJSpeech-1.1/mels/LJ039-0067.pt|which is ordinarily required when a marksman must raise his rifle as a target moves farther away. LJSpeech-1.1/mels/LJ038-0105.pt|They discovered two photographs, each showing Oswald with a rifle and a pistol. LJSpeech-1.1/mels/LJ040-0049.pt|He stated several times that he was a Communist but apparently never joined any Communist Party. LJSpeech-1.1/mels/LJ015-0030.pt|The bank had been conducted on false principles; LJSpeech-1.1/mels/LJ039-0172.pt|None of the marksmen had any practice with the assassination weapon except for exercising the bolt for two or three minutes on a dry run. LJSpeech-1.1/mels/LJ029-0088.pt|securing the roof and insuring the presence of numerous police officers inside and around the building. LJSpeech-1.1/mels/LJ009-0235.pt|and having first pulled him sideways, then got upon his shoulders, so that the rope broke. LJSpeech-1.1/mels/LJ013-0180.pt|The intention of the real murderer to shift the crime to burglars was evident although futile, LJSpeech-1.1/mels/LJ019-0215.pt|Why not move the city prison bodily into this more rural spot, with its purer air and greater breathing space? LJSpeech-1.1/mels/LJ009-0136.pt|that they reluctantly agreed to open the gallery which had formerly been occupied by strangers on these occasions. LJSpeech-1.1/mels/LJ034-0052.pt|In his independent investigation, Arthur Mandella of the New York City Police Department LJSpeech-1.1/mels/LJ007-0055.pt|The more peaceably disposed found some occupation in making Newgate tokens, LJSpeech-1.1/mels/LJ003-0018.pt|and discipline maintained by a system open to grave abuses, and which had the prescription of long usage, LJSpeech-1.1/mels/LJ028-0482.pt|but I, the devout petitioner, the worshipper of the gods, built the moat, and made its wall of burned brick and bitumen mountain high. LJSpeech-1.1/mels/LJ032-0123.pt|the rifle was released to the FBI and forwarded to Washington where it was examined on the morning of November twenty-three LJSpeech-1.1/mels/LJ043-0102.pt|It is possible that his immediate supervisor noticed the newspaper at that time because his attention had otherwise been drawn more directly to Oswald. LJSpeech-1.1/mels/LJ002-0212.pt|Mexico, and was consumed at the rate of a hogshead per week. LJSpeech-1.1/mels/LJ003-0039.pt|Giltspur Street, and the Poultry, or about four hundred and seventy-six in all. LJSpeech-1.1/mels/LJ047-0065.pt|This information led Hosty to review Oswald's file, from which he learned that Oswald had become a subscriber to the Worker, LJSpeech-1.1/mels/LJ032-0264.pt|tied with a string, lying on the floor of the Paines' garage. LJSpeech-1.1/mels/LJ005-0291.pt|In some large towns, as at Berwick on Tweed, Southampton, and Southwark, they (the prisons) are in a very discreditable condition. LJSpeech-1.1/mels/LJ007-0132.pt|The inspectors, however, honestly admitted that although the site of the prison was convenient, its construction was as bad as bad could be. LJSpeech-1.1/mels/LJ010-0067.pt|This Thistlewood had seen many vicissitudes throughout his strange, adventurous career. The son of a respectable Lincolnshire farmer, LJSpeech-1.1/mels/LJ004-0147.pt|The irons, which nearly every one wore, were remarkably heavy; those double ironed could not take off their small clothes. LJSpeech-1.1/mels/LJ028-0128.pt|His brief description of them should not be omitted. He says that Nebuchadnezzar LJSpeech-1.1/mels/LJ048-0019.pt|His activities for the Fair Play for Cuba Committee in New Orleans, we knew, were not of real consequence as he was not connected with any organized activity there. LJSpeech-1.1/mels/LJ025-0047.pt|The plant withdraws water and carbonic acid from the atmosphere, the animal contributes both to it. LJSpeech-1.1/mels/LJ031-0027.pt|Upon arriving at Parkland Hospital, LJSpeech-1.1/mels/LJ039-0167.pt|Using the assassination rifle mounted with the telescopic sight, three marksmen, rated as master by the National Rifle Association, LJSpeech-1.1/mels/LJ035-0117.pt|Harold Norman, and Bonnie Ray Williams -- were watching the parade from the fifth floor, directly below the window from which the shots were fired. LJSpeech-1.1/mels/LJ037-0201.pt|Heinz W. Michaelis, office manager of both George Rose and Co., Incorporated and Seaport Traders, Incorporated. LJSpeech-1.1/mels/LJ006-0203.pt|and he had thus ample means of introducing to the prisoners the prohibited but always much-coveted and generally procurable weed. LJSpeech-1.1/mels/LJ007-0209.pt|they return to the charge, and again call the corporation to task for their mismanagement of Newgate. LJSpeech-1.1/mels/LJ019-0084.pt|The greatest pains might be taken to secure isolation, LJSpeech-1.1/mels/LJ009-0138.pt|all the avenues to the prison gates were blocked by ticket-holders. LJSpeech-1.1/mels/LJ039-0215.pt|Frazier added that the scope would cause a slight miss to the right. LJSpeech-1.1/mels/LJ018-0172.pt|More than this, Griffiths took the police to a field where, in a bank, a number of other plates were secreted. LJSpeech-1.1/mels/LJ030-0091.pt|Rufus W. Youngblood, special agent in charge of the Vice President's detail, LJSpeech-1.1/mels/LJ037-0046.pt|The man, quote, in kind of a little trot, end quote, headed down Patton toward Jefferson Boulevard, a block away. LJSpeech-1.1/mels/LJ046-0223.pt|to Secret Service locally, end quote. LJSpeech-1.1/mels/LJ049-0175.pt|before the President reached Dallas. LJSpeech-1.1/mels/LJ021-0106.pt|the representatives of trade and industry were permitted to write their ideas into the codes. LJSpeech-1.1/mels/LJ009-0021.pt|in which it was said I had enlarged upon the heinous nature of his crime, and warned the public to avoid such conduct. LJSpeech-1.1/mels/LJ016-0343.pt|The sufferer was a porter on the London, Chatham, and Dover railway, sentenced to death for shooting the station-master at Dover. LJSpeech-1.1/mels/LJ030-0128.pt|From Main Street the motorcade turned right and went north on Houston Street, passing tall buildings on the right, LJSpeech-1.1/mels/LJ022-0003.pt|Since my annual message to the Congress on January fourth, last, I have not addressed the general public over the air. LJSpeech-1.1/mels/LJ016-0275.pt|As much as twenty-five pounds was paid for a first-floor front on this occasion. LJSpeech-1.1/mels/LJ002-0136.pt|and the disuse of the inferior courts. LJSpeech-1.1/mels/LJ018-0253.pt|For these crimes William Roupell was tried at the Central Criminal Court on the twenty-fourth September, eighteen sixty-two. LJSpeech-1.1/mels/LJ012-0200.pt|Bishop got weary of the dangers and fatigues of exhumation, and proposed to Williams that instead of disinterring they should murder their subjects. LJSpeech-1.1/mels/LJ008-0005.pt|The terrible spectacle was as demoralizing to the public, for whose admonition it was intended, LJSpeech-1.1/mels/LJ049-0096.pt|There have been a number of efforts to make assassination a Federal crime, particularly after the assassination of President McKinley LJSpeech-1.1/mels/LJ028-0148.pt|Then they set to building, and began by bricking the borders of the moat, after which they proceeded to construct the wall itself, LJSpeech-1.1/mels/LJ047-0218.pt|had discussed the President's visit on several occasions, including the regular biweekly conference on the morning of November twenty-two LJSpeech-1.1/mels/LJ005-0299.pt|The whole question was again dealt with in Lord John Russell's bill for the reform of the municipal corporations, and with a more liberal election of town councilors, LJSpeech-1.1/mels/LJ017-0250.pt|from Peru bound to Bordeaux, which had foundered at sea; LJSpeech-1.1/mels/LJ004-0062.pt|and the reason is plain: you have taken him from his home, and have deprived him of the means of providing himself with the necessaries or comforts of life, LJSpeech-1.1/mels/LJ013-0112.pt|Within a month or two the bank of Messrs. Rogers and Co., Clement's Lane, was broken into. LJSpeech-1.1/mels/LJ042-0110.pt|stated that Mrs. Oswald told her everybody in Russia, quote, hated him, end quote. LJSpeech-1.1/mels/LJ047-0210.pt|I think all of those, if we had them all together, LJSpeech-1.1/mels/LJ003-0210.pt|at night they were placed in the fifteen cells, two, three, or more together, according to the total number to be accommodated. LJSpeech-1.1/mels/LJ048-0083.pt|were discussed twice officially by the special agent in charge of the FBI office in Dallas. As discussed in chapter two, LJSpeech-1.1/mels/LJ002-0156.pt|Thomas Dobson, on twenty-second August, seventeen ninety-nine, for one shilling, with costs of eight shillings, ten pence. LJSpeech-1.1/mels/LJ028-0179.pt|It is only from their ruins that we may hope to obtain accurate information of the strongest fortifications in the ancient world. LJSpeech-1.1/mels/LJ037-0122.pt|The Dallas Police Department furnished the Commission with pictures of the men who appeared in the lineups with Oswald, LJSpeech-1.1/mels/LJ014-0055.pt|Next year John Gleeson Wilson, at Liverpool, murdered a woman, Ann Henrichson, also a maidservant and two children; LJSpeech-1.1/mels/LJ049-0028.pt|The Secret Service has therefore suggested this practice only on extraordinary occasions. LJSpeech-1.1/mels/LJ001-0020.pt|the "lower-case" being in fact invented in the early Middle Ages. LJSpeech-1.1/mels/LJ003-0333.pt|But here the recommendations touched at once upon the delicate subject of expense, and it is clear that the committee hesitated on this score. LJSpeech-1.1/mels/LJ038-0216.pt|The references to house rent and payments for water and gas LJSpeech-1.1/mels/LJ008-0287.pt|to make those sanctions an object of contemptuous mockery. LJSpeech-1.1/mels/LJ035-0003.pt|In considering whether Oswald was at the southeast corner window at the time the shots were fired, LJSpeech-1.1/mels/LJ028-0069.pt|how he cast Hebrew lads into a fiery furnace and into the lions' den, LJSpeech-1.1/mels/LJ043-0005.pt|Apart from his relatives, Oswald had no friends or close associates in Texas when he returned there in June of nineteen sixty-two, LJSpeech-1.1/mels/LJ016-0315.pt|Colonel (now Sir Edmund) Henderson was strongly in favor of them, LJSpeech-1.1/mels/LJ013-0152.pt|at Montreuil. He was arraigned at the Old Bailey, and the case fully proved. His sentence was seven years' transportation. LJSpeech-1.1/mels/LJ015-0090.pt|To account for his revenues he pretended to have been very lucky on the Stock Exchange, which was at one time true to a limited extent, LJSpeech-1.1/mels/LJ028-0185.pt|Perhaps Babylon was so strongly fortified that at first he made no attempt to add it to his empire, LJSpeech-1.1/mels/LJ014-0086.pt|This job was not completed till the following day, as the hole had to be enlarged, and the only tool they had was a dust-shovel. LJSpeech-1.1/mels/LJ018-0272.pt|Mrs. Tarpey was almost immediately captured and put on her trial, but she was acquitted on the plea that she had acted under the coercion of her husband. LJSpeech-1.1/mels/LJ004-0177.pt|No prison dress was allowed; no reception-room was provided, no soap, towels, or baths. LJSpeech-1.1/mels/LJ002-0079.pt|Its name and its situation were the same as those of the old place of carrying out the terrible sentence inflicted on accused persons who stood mute. LJSpeech-1.1/mels/LJ039-0231.pt|Having fired this slot LJSpeech-1.1/mels/LJ041-0106.pt|At the court-martial hearing which followed, Oswald admitted that he had been rather drunk when the incident occurred. LJSpeech-1.1/mels/LJ008-0305.pt|they never ceased cursing until the passion of anger so excited was exchanged for joy in some and grief in others. LJSpeech-1.1/mels/LJ046-0081.pt|The men in charge of protecting the President, confronted by complex problems and limited as they are in the measures they may employ, LJSpeech-1.1/mels/LJ003-0330.pt|The state side ceased to exist, and the female prisoners thus regained the space of which their quadrangle had been robbed. LJSpeech-1.1/mels/LJ022-0004.pt|In the many weeks since that time the Congress has devoted itself to the arduous task of formulating legislation necessary to the country's welfare. LJSpeech-1.1/mels/LJ017-0110.pt|He said nothing, but began to feel uneasy when he found that Cook's betting-book was missing, and that Palmer put it forward LJSpeech-1.1/mels/LJ014-0288.pt|That same evening he committed suicide in Newgate. LJSpeech-1.1/mels/LJ047-0245.pt|His secretary testified that she prepared such a report for him that afternoon and Chief of Police Jesse E. Curry LJSpeech-1.1/mels/LJ045-0200.pt|that over the weekend he did think about his wife's request that he not come to Irving, which was prompted by the birthday party being held at the Paine home. LJSpeech-1.1/mels/LJ025-0055.pt|by the employment of instruments of precision for the measurement of the physical forces which are at work in the living economy. LJSpeech-1.1/mels/LJ013-0222.pt|he did not shrink from murder, both for revenge and to conceal his other crimes. LJSpeech-1.1/mels/LJ050-0242.pt|even though it agrees with the Secret Service that it is preferable for the Service to have enough agents to handle all protective demands. LJSpeech-1.1/mels/LJ036-0046.pt|She testified, quote, I didn't like his attitude. There was just something about him I didn't like or want him. Just didn't want him around me, end quote, LJSpeech-1.1/mels/LJ014-0221.pt|On the contrary, many of them encouraged the brutal assailant in his savage attack. LJSpeech-1.1/mels/LJ045-0244.pt|Long before the assassination he expressed his hatred for American society and acted in protest against it. LJSpeech-1.1/mels/LJ010-0090.pt|Hand-grenades were to be thrown into the dining-room, and during the noise and confusion the assassination of the ministers was to be completed, LJSpeech-1.1/mels/LJ033-0199.pt|because other types of fibers present in the blanket were not found in the bag. LJSpeech-1.1/mels/LJ009-0141.pt|Lord Paget, Lord Bruce, several members of the House of Commons, and a few ladies. LJSpeech-1.1/mels/LJ010-0071.pt|It was during this period that he was said to have imbibed his revolutionary ideas. LJSpeech-1.1/mels/LJ027-0170.pt|Finally, it loses the tail, or rather its tail is absorbed and its material used in further development, and it becomes a perfect frog, LJSpeech-1.1/mels/LJ046-0049.pt|More often than not, Presidential journeys have served more than one purpose at the same time: ceremonial, LJSpeech-1.1/mels/LJ021-0045.pt|They saw that without changes in the policies and methods of investment LJSpeech-1.1/mels/LJ039-0145.pt|According to George De Mohrenschildt, Oswald said that he went target shooting with that rifle. LJSpeech-1.1/mels/LJ019-0392.pt|in the administration of prisons. LJSpeech-1.1/mels/LJ032-0067.pt|Postal Inspector Harry D. Holmes of the Dallas Post Office testified, however, that when a package is received for a certain box, LJSpeech-1.1/mels/LJ008-0249.pt|Blinded with their long hair, they tore at each other like two furies; their bonnets and caps were trodden underfoot in the kennel, LJSpeech-1.1/mels/LJ026-0019.pt|they cannot ingest solid food, but are nourished by a watery solution of nutrient materials. LJSpeech-1.1/mels/LJ011-0218.pt|spoke severely of the gross deception practiced upon an innocent girl, and sentenced the brothers each to three years' imprisonment, LJSpeech-1.1/mels/LJ021-0072.pt|Also, billions of dollars of invested capital have today a greater security of present and future earning power than before. LJSpeech-1.1/mels/LJ006-0174.pt|The aldermen never called upon him to report, and left him nearly unsupervised and uncontrolled. LJSpeech-1.1/mels/LJ044-0223.pt|whether or not he agreed with Castro that President Kennedy was a, quote, ruffian and a thief, end quote. He replied that he, quote, LJSpeech-1.1/mels/LJ045-0010.pt|The Commission has found no evidence that the extreme views expressed toward President Kennedy LJSpeech-1.1/mels/LJ040-0041.pt|There was some quality about him that led him to act with an apparent disregard for possible consequences. LJSpeech-1.1/mels/LJ032-0174.pt|but Mary Bledsoe, a former landlady of Oswald, saw him on a bus approximately ten minutes after the assassination LJSpeech-1.1/mels/LJ013-0223.pt|Courvoisier wished to commit suicide in Newgate, but was prevented by the vigilant supervision to which he was subjected while in jail. LJSpeech-1.1/mels/LJ023-0014.pt|In effect, four Justices ruled that the right under a private contract LJSpeech-1.1/mels/LJ050-0127.pt|should negotiate similar arrangements with such other State and local law enforcement agencies as may provide meaningful assistance. LJSpeech-1.1/mels/LJ019-0139.pt|These numbers would have still further decreased, and the jail would have been almost empty, but for the misdemeanants who were still sent to Newgate LJSpeech-1.1/mels/LJ022-0049.pt|The simple fact is that many million more people have private work today than two years ago today or one year ago today, LJSpeech-1.1/mels/LJ013-0246.pt|Some time elapsed before the imprisoned party could force open the doors, and by then the fugitive had escaped. LJSpeech-1.1/mels/LJ025-0095.pt|once supposed to be exclusively confined to plants, are now known to be regular and normal products of animals. LJSpeech-1.1/mels/LJ022-0033.pt|"To get away from the trees", as they say, "and to look at the whole forest." LJSpeech-1.1/mels/LJ038-0305.pt|The finding that Lee Harvey Oswald attempted to murder a public figure in April nineteen sixty-three LJSpeech-1.1/mels/LJ027-0101.pt|Throughout both the animal and vegetable kingdoms dwarfed and useless representatives of organs are constantly met with, LJSpeech-1.1/mels/LJ022-0054.pt|The first is to make provisions intended to relieve, to minimize, and to prevent future unemployment; LJSpeech-1.1/mels/LJ012-0110.pt|The police lost all trace of them for some days, but at length Sullivan's brother was followed from the house in Kennington to the above-mentioned tavern. LJSpeech-1.1/mels/LJ038-0158.pt|Jarman testified that he ate his lunch on the first floor around five minutes to twelve, and that he neither ate lunch with nor saw Oswald. LJSpeech-1.1/mels/LJ027-0061.pt|in order to enclose and protect a similar enlargement of the nervous center, LJSpeech-1.1/mels/LJ042-0092.pt|No evidence has been found that they used him for any particular propaganda or other political or informational purposes. LJSpeech-1.1/mels/LJ017-0141.pt|could not divest his mind of serious doubt, and of which the murderer got the benefit. LJSpeech-1.1/mels/LJ032-0181.pt|Although Stombaugh was unable to estimate the period of time the fibers were on the rifle he said that the fibers, quote, LJSpeech-1.1/mels/LJ008-0076.pt|When she came out of prison she appeared languid and terrified, and trembled greatly as she advanced to the stake, LJSpeech-1.1/mels/LJ029-0205.pt|for President Kennedy, stating that "in many respects Dallas County has isolated itself from the main stream of life in the world in this decade. LJSpeech-1.1/mels/LJ014-0126.pt|her face was comely, she had dark hair and good eyes, and was above the middle height, yet inclined to be stout. LJSpeech-1.1/mels/LJ025-0087.pt|On the other hand, the definition thus amended will exclude all ordinary vegetable organisms. LJSpeech-1.1/mels/LJ028-0158.pt|The city wall is brought down on both sides to the edge of the stream, LJSpeech-1.1/mels/LJ019-0064.pt|that their condition was more natural, and approximated more nearly to that of daily life. LJSpeech-1.1/mels/LJ001-0036.pt|But about the same year Mentelin at Strasburg began to print in a type which is distinctly Roman; LJSpeech-1.1/mels/LJ018-0153.pt|the officers ensconced themselves in the latter, and waited for Buncher's expected visit. LJSpeech-1.1/mels/LJ049-0150.pt|A Cabinet-level committee which is actively concerned with these problems would be able to discuss these matters more effectively with the President. LJSpeech-1.1/mels/LJ018-0389.pt|Of the lesser criminals, forgers, thieves, swindlers, Newgate continued to receive its full share up to the last. LJSpeech-1.1/mels/LJ021-0121.pt|But I would point out that the extent and severity of labor disputes during this period LJSpeech-1.1/mels/LJ046-0241.pt|PRS required a more direct indication of a threat to the President, and that there was no such indication until the President's scheduled visit to that area became known. LJSpeech-1.1/mels/LJ009-0009.pt|This rule has some, but very few, exceptions; such as where a hardened offender behaves with great levity and brutality, as if he cared nought for his life, LJSpeech-1.1/mels/LJ011-0256.pt|By this time the neighbors were aroused, and several people came to the scene of the affray. LJSpeech-1.1/mels/LJ020-0098.pt|Having made out your rolls and tucked them up snugly for the final rise, return to your chamber for a comfortable bath and toilet. LJSpeech-1.1/mels/LJ018-0223.pt|In eighteen fifty-six the father died. LJSpeech-1.1/mels/LJ028-0045.pt|When Esarhaddon died, one of his sons, Samas-sum-yukin, was made King of Babylon. LJSpeech-1.1/mels/LJ019-0242.pt|Newgate naturally shared in any advantages due to these reforms. I propose, therefore, to refer to them in the concluding pages of this work, LJSpeech-1.1/mels/LJ022-0185.pt|The answer to this demand was the Federal Reserve System. LJSpeech-1.1/mels/LJ024-0104.pt|I am therefore, going to spend my time, my efforts and my money LJSpeech-1.1/mels/LJ028-0276.pt|a marvelous thing happened to Zopyrus, son of the Megabyzus who was among the seven men that overthrew the Magus. LJSpeech-1.1/mels/LJ013-0140.pt|A robbery of a somewhat novel kind was executed in rather a bungling fashion by Ker, a sea-captain, LJSpeech-1.1/mels/LJ028-0372.pt|The poor of the surrounding country occupied its dismantled palaces. LJSpeech-1.1/mels/LJ025-0076.pt|Many animals of even complex structure which live parasitically within others are wholly devoid of an alimentary cavity. LJSpeech-1.1/mels/LJ016-0120.pt|This was considered safer than intrusting him with keys. LJSpeech-1.1/mels/LJ015-0285.pt|and when these presented themselves, entrusted them as a beginning with the duty of cashing cheques. LJSpeech-1.1/mels/LJ046-0201.pt|were no more specific than the broad and general instructions its own agents and the White House mailroom. LJSpeech-1.1/mels/LJ030-0109.pt|The Vice-Presidential car LJSpeech-1.1/mels/LJ009-0093.pt|Why does no one stir to help him? Where would be the use? The hardened burglar moves not, nor does he speak; LJSpeech-1.1/mels/LJ013-0194.pt|but on the second day the discovery of fresh evidence, more particularly the recovery of some of Lord William's stolen plate, LJSpeech-1.1/mels/LJ001-0065.pt|This was notably the case with the early works printed at Ulm, and in a somewhat lesser degree at Augsburg. LJSpeech-1.1/mels/LJ034-0171.pt|Edwards said, quote, Look at that guy there in that window, end quote, LJSpeech-1.1/mels/LJ040-0107.pt|but apparently was not able to spend as much time with them as he would have liked, because of the age gaps of five and seven years, LJSpeech-1.1/mels/LJ017-0280.pt|The convicts were pinioned one by one and sent singly out to the gallows. LJSpeech-1.1/mels/LJ028-0079.pt|The museum authorities believed that the cameo was one of the many spurious objects which the Eastern forgers were constantly sending to Europe, LJSpeech-1.1/mels/LJ022-0066.pt|will not only help to guard the individual in future periods of lay-off against dependence upon relief, LJSpeech-1.1/mels/LJ012-0095.pt|The jewels had belonged to a Spanish countess recently deceased, who had sent them to England for greater security on the outbreak of the first Carlist war. LJSpeech-1.1/mels/LJ024-0035.pt|Let me answer this question with a bluntness that will end all honest misunderstanding of my purposes. LJSpeech-1.1/mels/LJ007-0163.pt|all the tumultuous and diversified passions and emotions which circumstances like these must necessarily generate LJSpeech-1.1/mels/LJ034-0021.pt|Sebastian F. Latona, supervisor of the Latent Fingerprint Section, LJSpeech-1.1/mels/LJ008-0284.pt|Nothing could be more strongly marked than the contrast between the ultimate destiny of different individuals all abiding the same awful doom: LJSpeech-1.1/mels/LJ041-0138.pt|and that she could not think of any reason why Oswald would want to kill President Kennedy. LJSpeech-1.1/mels/LJ017-0043.pt|The direful suspicions which surrounded the case filled the whole country with uneasiness and misgiving, LJSpeech-1.1/mels/LJ008-0219.pt|their conversation was of companions and associates of former years, long ago imprisoned, transported, hanged, while they, LJSpeech-1.1/mels/LJ030-0120.pt|had to leave the left front running board of the President's follow-up car four times to ride on the rear of the President's limousine. LJSpeech-1.1/mels/LJ037-0165.pt|with five lands and grooves and a right twist which were the rifling characteristics of the revolver taken from Oswald. LJSpeech-1.1/mels/LJ012-0020.pt|He began as an itinerant street vendor at eight, at ten he passed bad money, LJSpeech-1.1/mels/LJ016-0337.pt|In the houses opposite the prison numbers of detectives mixed with the spectators; LJSpeech-1.1/mels/LJ050-0011.pt|The Chief of the Service now reports to the Secretary of the Treasury LJSpeech-1.1/mels/LJ035-0016.pt|He saw pigeons flutter upward. He was not certain, quote, but I am pretty sure they came from the building right on the northwest corner, end quote. LJSpeech-1.1/mels/LJ018-0364.pt|It will be remembered that she made a statement which led to the empaneling of a jury of matrons, who decided that there was no cause for an arrest of judgment. LJSpeech-1.1/mels/LJ006-0073.pt|of his many manifest duties, but I shall here confine myself to animadverting on his neglect as regards the appropriation of his prison. LJSpeech-1.1/mels/LJ026-0130.pt|and may thus be easily transported to all parts of the plant. LJSpeech-1.1/mels/LJ017-0228.pt|till every feature was obliterated, and then, still living, flung him into the sea. LJSpeech-1.1/mels/LJ003-0098.pt|the inevitable consequence of such a situation, their morals must have been destroyed; LJSpeech-1.1/mels/LJ006-0151.pt|Many of them were otherwise and improperly occupied for hours every day in menial services for the governor, cleaning his windows or grooming his horse. LJSpeech-1.1/mels/LJ007-0172.pt|where is to be found in operation every expedient by which Ignorance may be superseded by Knowledge, Idleness by Industry, and Suffering by Benevolence; LJSpeech-1.1/mels/LJ004-0034.pt|Moreover, the laws applied more particularly to county jurisdictions. LJSpeech-1.1/mels/LJ024-0099.pt|even though the thirty- five states with ninety-five percent of the population are in favor of it. LJSpeech-1.1/mels/LJ048-0263.pt|During entire periods of travel status, LJSpeech-1.1/mels/LJ011-0226.pt|which was based on his jail experiences, and of which I have availed myself in the last chapter. LJSpeech-1.1/mels/LJ041-0006.pt|His mother exercised little control over him and thought he could decide for himself whether to go on in school. LJSpeech-1.1/mels/LJ011-0267.pt|Mr. Gee had invested one thousand two hundred pounds of this, and was seeking how best to place the remaining eight hundred pounds, LJSpeech-1.1/mels/LJ002-0120.pt|had been issued for the arrests of debtors in the kingdom, for sums varying from fourpence to five hundred pounds and upwards. LJSpeech-1.1/mels/LJ014-0064.pt|He lived at Mile End, whence he walked often to call at three, Minver Place, Bermondsey, the residence of his old love. LJSpeech-1.1/mels/LJ027-0123.pt|where within the limits of the same natural group of organisms a rudiment is sometimes present and sometimes absent. LJSpeech-1.1/mels/LJ019-0224.pt|With the reduction of numbers to be accommodated, there was ample space in Newgate for its reconstruction on the most approved modern lines. LJSpeech-1.1/mels/LJ036-0031.pt|and requested a transfer which she might use if she got through the traffic. LJSpeech-1.1/mels/LJ025-0034.pt|Animals further needed muscles for locomotion and nerves for sensibility. LJSpeech-1.1/mels/LJ050-0106.pt|to devise a practical system which has any reasonable possibility of revealing such malcontents. LJSpeech-1.1/mels/LJ019-0066.pt|with the means of earning an honest livelihood if so disposed. LJSpeech-1.1/mels/LJ026-0011.pt|Because of these uncertain forms of life, LJSpeech-1.1/mels/LJ028-0515.pt|Such were the walls of Babylon, LJSpeech-1.1/mels/LJ016-0332.pt|who was convicted of complicity in the Clerkenwell explosion, intended to effect the release of Burke and Casey LJSpeech-1.1/mels/LJ028-0344.pt|for Cyrus had done neither the one nor the other when he took Babylon. LJSpeech-1.1/mels/LJ006-0032.pt|Messrs. Crawford and Russell proceeded to carry out their new functions with commendable energy, and without a moment's loss of time. LJSpeech-1.1/mels/LJ049-0187.pt|These proposals included suggestions to locate exclusive responsibility for all phases of the work LJSpeech-1.1/mels/LJ010-0063.pt|The massacre of the whole of the Cabinet Ministers at one stroke was to be followed by an attack LJSpeech-1.1/mels/LJ001-0139.pt|a blemish which can be nearly, though not wholly, avoided by care and forethought LJSpeech-1.1/mels/LJ045-0083.pt|On that issue George De Mohrenschildt, who was probably as close to the Oswalds as anyone else during their first stay in Dallas, LJSpeech-1.1/mels/LJ019-0264.pt|and it was decidedly of opinion that in all short sentences the hard labor of the tread-wheel, crank, and so forth should be the invariable rule. LJSpeech-1.1/mels/LJ015-0050.pt|Following this, warrants were issued for their arrest, LJSpeech-1.1/mels/LJ019-0040.pt|the difficulty of access, and the admitted necessity of giving architectural importance to this the national model prison. LJSpeech-1.1/mels/LJ012-0199.pt|After a little LJSpeech-1.1/mels/LJ020-0014.pt|beating the batter smooth as you go on until all of the liquid and flour has gone in. LJSpeech-1.1/mels/LJ009-0022.pt|I was informed that this unnecessarily harassed his feelings, and that the object of such sermons was solely to console the prisoner, LJSpeech-1.1/mels/LJ030-0024.pt|In Dallas the rain had stopped, and by midmorning a gloomy overcast sky had given way to the bright sunshine that greeted the Presidential party LJSpeech-1.1/mels/LJ047-0176.pt|shortly after Oswald rented the room on October fourteen. LJSpeech-1.1/mels/LJ013-0107.pt|but he escaped through a back door on to the river, and rowed off in a boat to a hiding-place in the woods. LJSpeech-1.1/mels/LJ008-0109.pt|As we crossed the press yard a cock crew, and the solitary clanking of a restless chain was dreadfully horrible. LJSpeech-1.1/mels/LJ018-0381.pt|the wildest and most cut-throat looking of the lot, which proves that he could be grateful for kindness, and was not all bad. LJSpeech-1.1/mels/LJ050-0135.pt|According to Secretary Dillon, LJSpeech-1.1/mels/LJ030-0247.pt|I was bent over under the weight of Agent Youngblood's body, toward Mrs. Johnson and Senator Yarborough, end quote, LJSpeech-1.1/mels/LJ012-0184.pt|Meanwhile the discovery of pistol and knife spattered with human blood and brains LJSpeech-1.1/mels/LJ021-0046.pt|there could be no recovery of public confidence in the security of savings. LJSpeech-1.1/mels/LJ042-0236.pt|In the second simulated transcript which ended with the statement, quote, Newspapers thank you, sir. You are a real patriot! End quote. LJSpeech-1.1/mels/LJ048-0002.pt|Chapter eight. The Protection of the President. Part three. LJSpeech-1.1/mels/LJ047-0199.pt|The Secret Service and the FBI differ LJSpeech-1.1/mels/LJ002-0238.pt|was used for debtors arrested for the lowest sums within twelve miles of the palace of Whitehall; LJSpeech-1.1/mels/LJ036-0072.pt|to Murphy and Elm three times, averaging six point five minutes for the three trips. LJSpeech-1.1/mels/LJ048-0220.pt|Conduct of Secret Service agents in Fort Worth on November twenty-two. LJSpeech-1.1/mels/LJ015-0208.pt|they sounded one Burgess, a guard on the South-Eastern Railway, a line by which large quantities of bullion were sent to the Continent. LJSpeech-1.1/mels/LJ043-0031.pt|I am surprised that he didn't do something worse, end quote. LJSpeech-1.1/mels/LJ002-0287.pt|There were no beds or bedding, no straw even. LJSpeech-1.1/mels/LJ003-0294.pt|This committee made its report in September the following year, and an excellent report it is, so far as its recommendations are concerned. LJSpeech-1.1/mels/LJ002-0256.pt|A committee of collegians was elected to act as the executive, also a secretary or accountant to receive monies and keep books, LJSpeech-1.1/mels/LJ034-0096.pt|on the southwest corner of Elm and Houston Streets, looking north at the Depository Building which was directly in front of him. LJSpeech-1.1/mels/LJ028-0308.pt|Let neither these nor the former troops be armed with any weapons but their swords those thou mayest leave them. LJSpeech-1.1/mels/LJ008-0004.pt|The reasons for this change were fully set forth in a previous chapter. LJSpeech-1.1/mels/LJ044-0080.pt|was apparently not enough to satisfy him. He exaggerated in his letters to V. T. Lee in an apparent attempt LJSpeech-1.1/mels/LJ006-0169.pt|He really did not know what passed in his jail LJSpeech-1.1/mels/LJ040-0098.pt|Marguerite Oswald worked in miscellaneous jobs after her divorce from Ekdahl. LJSpeech-1.1/mels/LJ038-0306.pt|was considered of probative value in this investigation, although the Commission's conclusion concerning the identity of the assassin LJSpeech-1.1/mels/LJ038-0187.pt|I paid for the box last month so don't worry about it. LJSpeech-1.1/mels/LJ015-0243.pt|At Redhill Tester met the train and relieved the thieves of a portion of the stolen gold. LJSpeech-1.1/mels/LJ005-0191.pt|The Society proceeded to support this indictment by facts. It is much the old story. LJSpeech-1.1/mels/LJ037-0028.pt|He saw him empty the gun and throw the shells into some bushes on the southeast corner lot. LJSpeech-1.1/mels/LJ010-0011.pt|This led to a rapid and marked increase in all kinds of fraud; LJSpeech-1.1/mels/LJ043-0020.pt|The relations between Oswald and his wife became such that Bouhe wanted to "liberate" her from Oswald. LJSpeech-1.1/mels/LJ011-0177.pt|The fact was, Wakefield went on to say, an uncle of his had advanced Mr. Turner sixty thousand pounds, which had temporarily staved off ruin. LJSpeech-1.1/mels/LJ028-0434.pt|the large high mound, which resembles a mountain from a distance, still bears the ancient name Babel. LJSpeech-1.1/mels/LJ042-0202.pt|It has turned itself into the traditional lever of a foreign power to overthrow the government of the United States; LJSpeech-1.1/mels/LJ027-0074.pt|Sometimes a piece is enlarged, sometimes diminished, or even becomes obsolete; sometimes several pieces are consolidated into one; LJSpeech-1.1/mels/LJ006-0145.pt|He could indulge in snuff if a snuff-taker, LJSpeech-1.1/mels/LJ035-0001.pt|Report of the President's Commission on the Assassination of President Kennedy. The Warren Commission Report. By The President's Commission on the Assassination of President Kennedy. LJSpeech-1.1/mels/LJ012-0162.pt|Having brought down the records of great frauds, forgeries, and thefts from about eighteen twenty-five to eighteen forty, LJSpeech-1.1/mels/LJ039-0021.pt|I called him into the bathroom and I closed the door and I wanted to prevent him and then I started to cry. LJSpeech-1.1/mels/LJ017-0128.pt|At the last moment Palmer tossed a bit of paper over to his counsel, on which he had written, quote, I think there will be a verdict of Not Guilty, end quote. LJSpeech-1.1/mels/LJ043-0143.pt|with his recently acquired rifle and pistol, a copy of the March twenty-four, nineteen sixty-three, issue of the Worker, LJSpeech-1.1/mels/LJ035-0147.pt|Mrs. Reid had watched the parade from the sidewalk in front of the building with Truly and Mr. O. V. Campbell, vice president of the Depository. LJSpeech-1.1/mels/LJ048-0092.pt|The advance preparations in Dallas by Agent Winston G. Lawson of the White House detail have been described in chapter two. LJSpeech-1.1/mels/LJ006-0179.pt|But, indeed, his whole rule was far too mild, and under this mistaken leniency LJSpeech-1.1/mels/LJ017-0187.pt|Her husband, who came up to town, would not allow a post-mortem, and again Mrs. Wilson escaped. LJSpeech-1.1/mels/LJ028-0132.pt|Yet as large and lofty as they were, they were completed in fifteen days. LJSpeech-1.1/mels/LJ042-0053.pt|Responding to Robert's statement that he had not "renounced" him, LJSpeech-1.1/mels/LJ009-0112.pt|the burglar muttering curses and savage expressions of defiance; whilst the poor sheep-stealer shakes hands with the turnkeys, LJSpeech-1.1/mels/LJ019-0150.pt|Captain Williams, who was the inspector of prisons for the home district in succession to Messrs. Crawford and Russell, LJSpeech-1.1/mels/LJ030-0020.pt|if anybody really wanted to shoot the President of the United States, it was not a very difficult job LJSpeech-1.1/mels/LJ029-0033.pt|particularly in large cities where the purpose was to let the President be seen by as many people as possible. LJSpeech-1.1/mels/LJ028-0098.pt|the wise, the pious, the maintainer of Esagil and Ezida, LJSpeech-1.1/mels/LJ028-0014.pt|The desert about you shows no signs of life; LJSpeech-1.1/mels/LJ003-0346.pt|It pointed out that the Government was to blame for the overcrowding, and might diminish it if it chose. LJSpeech-1.1/mels/LJ038-0214.pt|and the other paragraphs instructed her on the disposal of Oswald's personal effects and the management of her affairs if he should not return. LJSpeech-1.1/mels/LJ050-0122.pt|It should be made clear that the Secret Service will in no way seek to duplicate the intelligence LJSpeech-1.1/mels/LJ018-0143.pt|each containing two notes, many of the sheets suitable for engraving any kind of note from one thousand pounds downwards. LJSpeech-1.1/mels/LJ023-0126.pt|In other words, we said we would seek an amendment only if every other possible means by legislation were to fail. LJSpeech-1.1/mels/LJ048-0015.pt|We talked to him twice. LJSpeech-1.1/mels/LJ049-0179.pt|The Commission believes that both the FBI and the Secret Service have too narrowly construed their respective responsibilities. LJSpeech-1.1/mels/LJ050-0269.pt|The essential terms of such memoranda might well be embodied in an Executive order. LJSpeech-1.1/mels/LJ006-0265.pt|The untried might see their friends three times a week, the convicted only once. LJSpeech-1.1/mels/LJ013-0160.pt|who, on going down early, was surprised to find the dining-room in a state of utter confusion; LJSpeech-1.1/mels/LJ032-0040.pt|were written the words "A. Hidell, P.O. Box two nine one five Dallas, Texas." LJSpeech-1.1/mels/LJ006-0261.pt|together with four bradawls, several large iron spikes, screws, nails, and knives; LJSpeech-1.1/mels/LJ033-0114.pt|When Frazier appeared before the Commission and was asked to demonstrate how Oswald carried the package, he said, quote, Like I said, LJSpeech-1.1/mels/LJ034-0163.pt|The Commission is satisfied that, at the least, LJSpeech-1.1/mels/LJ032-0125.pt|In his testimony before the Commission, Latona stated that when he received the rifle, the area where prints were visible was protected by cellophane. LJSpeech-1.1/mels/LJ008-0189.pt|All the avenues and approaches, places even whence nothing whatever could be seen of the scaffold, LJSpeech-1.1/mels/LJ016-0334.pt|Unusual precautions were taken upon this occasion, as some fresh outrage was apprehended. LJSpeech-1.1/mels/LJ006-0114.pt|They bought their offices from one another, and were thus considered to have a vested interest in them. LJSpeech-1.1/mels/LJ007-0214.pt|"The prominent evils of this prison (Newgate) -- evils which the alterations made within the last four years have failed to remove LJSpeech-1.1/mels/LJ005-0213.pt|Newgate through all these years continued a bye-word with the Society. LJSpeech-1.1/mels/LJ013-0011.pt|She was freighted by the firm of Zulueta and Co. for a voyage to Santa Cruz. LJSpeech-1.1/mels/LJ009-0249.pt|When Charles White was executed in eighteen twenty-three for arson, he arranged a handkerchief LJSpeech-1.1/mels/LJ039-0005.pt|Richard M. Nixon Incident LJSpeech-1.1/mels/LJ019-0083.pt|The discipline also varied greatly, from the severely penal to the culpably lax. LJSpeech-1.1/mels/LJ037-0217.pt|Police found an empty revolver holster when they searched Oswald's room on Beckley Avenue after his arrest. LJSpeech-1.1/mels/LJ042-0117.pt|he noted that one of his acquaintances, quote, relates many things I do not know about the U.S.S.R. LJSpeech-1.1/mels/LJ008-0035.pt|were told that the plan had been well considered, and would be persevered in. LJSpeech-1.1/mels/LJ048-0016.pt|He likewise indicated he was disenchanted with Russia. LJSpeech-1.1/mels/LJ014-0130.pt|Manning, when sentence of death was passed on him, said nothing; LJSpeech-1.1/mels/LJ026-0050.pt|following in part the comparisons of certain animals and plants by Sedgwick and Wilson and others. LJSpeech-1.1/mels/LJ009-0044.pt|His features have no felonious cast; LJSpeech-1.1/mels/LJ010-0024.pt|While the varying conditions of social life thus brought about many changes in the character of offenses against property, LJSpeech-1.1/mels/LJ047-0021.pt|information regarding his relations with the U.S. Embassy in Moscow and background data relating largely to his prior military service, LJSpeech-1.1/mels/LJ012-0224.pt|who examined Bishop and his fellows, and further incriminating evidence adduced, to the effect that the prisoners had bartered for a coach to carry "a stiff 'un"; LJSpeech-1.1/mels/LJ019-0096.pt|other authorities as strongly condemned it as brutalizing, unequal in its operation, and altogether a "deplorable invention." LJSpeech-1.1/mels/LJ006-0048.pt|To these were still added an average of about fifty expecting the last penalty of the law; a certain number of transports awaiting removal to the colonies; LJSpeech-1.1/mels/LJ038-0277.pt|I am aware of their position. This is not, I am sure, arrived at without careful consideration. LJSpeech-1.1/mels/LJ041-0170.pt|Thornley testified, quote, At which time he looked at me like a betrayed Caesar and screamed, screamed definitely, "Not you, too, Thornley!" LJSpeech-1.1/mels/LJ046-0136.pt|Before the assassination of President Kennedy, LJSpeech-1.1/mels/LJ029-0056.pt|Although there was no mention in PRS files of the demonstration in Dallas against Ambassador Adlai Stevenson on October twenty-fourth, LJSpeech-1.1/mels/LJ007-0217.pt|They go on to say LJSpeech-1.1/mels/LJ046-0194.pt|Members of the White House detail were expected to familiarize themselves with the descriptions and photographs of the highest risk cases. LJSpeech-1.1/mels/LJ038-0239.pt|indicated that the bullet was fired from a position near the point where one of the photographs was taken. LJSpeech-1.1/mels/LJ008-0263.pt|Forty-eight hours was the limit of time allowed to the unhappy man to make his peace, and during that time he was still kept on a bare allowance of bread and water. LJSpeech-1.1/mels/LJ023-0084.pt|When the Congress has sought to stabilize national agriculture, to improve the conditions of labor, LJSpeech-1.1/mels/LJ039-0146.pt|Marina Oswald testified that in New Orleans in May of nineteen sixty-three, she observed Oswald sitting with the rifle on their screened porch at night, LJSpeech-1.1/mels/LJ039-0226.pt|the Marine marksmanship experts, Major Anderson and Sergeant Zahm, concurred in the opinion that Oswald had the capability to fire three shots, LJSpeech-1.1/mels/LJ049-0076.pt|The Commission's review of the provisions for Presidential protection at the time of President Kennedy's trip to Dallas demonstrates the need for substantial improvements. LJSpeech-1.1/mels/LJ014-0293.pt|He returned from court in a state of gloomy dejection, LJSpeech-1.1/mels/LJ043-0033.pt|Bouhe thoroughly disapproved of this and as a result almost all communication between the Oswalds and members of the Russian community ceased. LJSpeech-1.1/mels/LJ023-0035.pt|For in the last three national elections LJSpeech-1.1/mels/LJ028-0001.pt|The Seven Wonders of the Ancient World. By Edgar J. Banks. Chapter two. The Walls of Babylon. LJSpeech-1.1/mels/LJ007-0095.pt|Prisoners indeed were known to boast that they had saved their necks by feigning insanity. LJSpeech-1.1/mels/LJ002-0237.pt|This very ancient prison, which stood in the High Street, Southwark, LJSpeech-1.1/mels/LJ036-0182.pt|She recalled that it was subsequent to the time the President had been shot. LJSpeech-1.1/mels/LJ032-0089.pt|It certified that Lee Harvey Oswald had been vaccinated for smallpox on June eight, nineteen sixty-three. LJSpeech-1.1/mels/LJ043-0018.pt|He was offensive with the people. And I can understand why, because that hurt him. LJSpeech-1.1/mels/LJ048-0210.pt|He was handicapped, however, by the fact that he was riding in a closed car whose roof at times obscured his view. LJSpeech-1.1/mels/LJ033-0074.pt|Marina Oswald testified that this was her first knowledge that the rifle was not in its accustomed place. LJSpeech-1.1/mels/LJ040-0195.pt|It appears that he did not want to do any of the things which the authorities suggested in their efforts to bring him out of the shell LJSpeech-1.1/mels/LJ007-0183.pt|traversing where it was possible the statements of the inspectors, and offering explanation and palliation of such evils as could not be denied. LJSpeech-1.1/mels/LJ038-0232.pt|Marina Oswald stated that when Oswald returned home on the night of the Walker shooting, he told her that he had been planning the attempt for two months. LJSpeech-1.1/mels/LJ031-0055.pt|Dr. Perry noted the President's back brace as he felt for a femoral pulse, which he did not find. LJSpeech-1.1/mels/LJ018-0332.pt|Greed in the latter case was a secondary motive; LJSpeech-1.1/mels/LJ022-0001.pt|The Fireside Chats of Franklin Delano Roosevelt, by Franklin D Roosevelt, Section seven. LJSpeech-1.1/mels/LJ024-0107.pt|The first includes those who fundamentally object to social and economic legislation along modern lines. LJSpeech-1.1/mels/LJ030-0070.pt|Motorcycles. -- Four motorcycles, two on each side, flanked the rear of the Presidential car. LJSpeech-1.1/mels/LJ025-0048.pt|Respiration -- that is, the absorption of oxygen and the exhalation of carbonic acid LJSpeech-1.1/mels/LJ038-0237.pt|The Commission confirmed, by comparison with other photographs, that these were, indeed, photographs of the rear of Walker's house. LJSpeech-1.1/mels/LJ043-0032.pt|After about a two-week separation, Marina Oswald returned to her husband. LJSpeech-1.1/mels/LJ021-0177.pt|Did England hold to the gold standard when her reserves were threatened? LJSpeech-1.1/mels/LJ001-0089.pt|but his letters, though uninteresting and poor, are not nearly so gross and vulgar as those of either the Italian or the Frenchman. LJSpeech-1.1/mels/LJ034-0210.pt|The picture which gave rise to these allegations was taken by Associated Press Photographer James W. Altgens, LJSpeech-1.1/mels/LJ010-0272.pt|This son, John William Bean, was fully identified by Dasset, and presently examined by the Privy Council. LJSpeech-1.1/mels/LJ012-0179.pt|The others followed, and on overtaking Thurtell, found he had done the job alone in a retired part of the road known as Gill's Hill Lane. LJSpeech-1.1/mels/LJ032-0126.pt|He examined these prints, as well as photographs of them which the Dallas police had made, and concluded that: LJSpeech-1.1/mels/LJ016-0413.pt|No less than sixty-seven persons were present, admitted by special permission of the sheriff. LJSpeech-1.1/mels/LJ010-0032.pt|Pegsworth, and Greenacre, and Daniel Good merely reproduced types that had gone before, and that have since reappeared. LJSpeech-1.1/mels/LJ029-0015.pt|The party itself saw an opportunity to raise funds by having the President speak at a political dinner eventually planned for Austin. LJSpeech-1.1/mels/LJ033-0169.pt|it would be the thickness of both the paper and the tape, the color under various lighting conditions of both the paper and the tape, LJSpeech-1.1/mels/LJ047-0121.pt|stated the Bureau's reasoning in this way, quote, LJSpeech-1.1/mels/LJ021-0197.pt|of referring without rhyme or reason to the Constitution as a means of preventing its accomplishment, thus creating the general impression LJSpeech-1.1/mels/LJ004-0216.pt|The most noticeable of the improvements introduced was a better regulation of dietaries within the prison. LJSpeech-1.1/mels/LJ042-0162.pt|Full of optimism and hope, he stood in Red Square in the Fall of nineteen fifty-nine, vowing to see his chosen course through, LJSpeech-1.1/mels/LJ012-0008.pt|He had sought by all legal means to obtain possession of the two thousand pounds, but had failed, and had had recourse to more violent means. LJSpeech-1.1/mels/LJ036-0191.pt|he would have reached tenth and Patton shortly after one:fifteen p.m. LJSpeech-1.1/mels/LJ010-0137.pt|Davidson, who was the only one who seemed to realize his awful situation, listened patiently and with thankfulness to the chaplain, LJSpeech-1.1/mels/LJ006-0063.pt|minor offenders charged with small thefts or non-payment of small sums were cheek by jowl with convicts sentenced to long terms of transportation. LJSpeech-1.1/mels/LJ022-0188.pt|Certain proposals made to amend the Federal Reserve Act deserve prompt and favorable action by the Congress. LJSpeech-1.1/mels/LJ039-0026.pt|she stated that she might have been confused about shutting him in the bathroom, but that, quote, there is no doubt that he got dressed and got a gun, end quote, LJSpeech-1.1/mels/LJ038-0036.pt|As McDonald started to search Oswald's waist for a gun, he heard him say, quote, Well, it's all over now, end quote. LJSpeech-1.1/mels/LJ041-0146.pt|it was more in terms of a general hostility against the government and its representatives rather than a grudge against any particular person. LJSpeech-1.1/mels/LJ034-0128.pt|But the testimony of these employees, together with photographs subsequently taken of them at the scene of the assassination, LJSpeech-1.1/mels/LJ039-0121.pt|and he probably didn't have as high a motivation because he was no longer in recruit training and under the care of the drill instructor. LJSpeech-1.1/mels/LJ011-0182.pt|Miss Turner, thus pressed, consented to go on to Gretna Green. LJSpeech-1.1/mels/LJ008-0042.pt|is enclosed by a temporary roof, under which are placed two seats for the reception of the sheriffs, one on each side of the stairs leading to the scaffold. LJSpeech-1.1/mels/LJ026-0135.pt|If a larger quantity of starch is formed in the chlorophyll bodies than is immediately needed by the protoplasm for purposes of repair or growth, LJSpeech-1.1/mels/LJ003-0226.pt|The rations of food were notoriously inadequate, and so carelessly distributed, that many were left to starve. LJSpeech-1.1/mels/LJ044-0115.pt|he felt that this was a great man that he had received the letter from, end quote. LJSpeech-1.1/mels/LJ011-0270.pt|but on arrival he was met by a young sailor with a letter which begged Mr. Gee to go to Heath's house, as the latter was not well. LJSpeech-1.1/mels/LJ016-0105.pt|These men were all in prison dress at the time of their escape, but one of their number, Bell, sent back his clothes a few days later by parcel's delivery, LJSpeech-1.1/mels/LJ003-0033.pt|Enough has been said, probably, to prove that there was room for improvement in the condition and treatment of debtors in the prisons of the city of London. LJSpeech-1.1/mels/LJ036-0156.pt|He was in error, however. LJSpeech-1.1/mels/LJ028-0039.pt|We know the names of its kings, and the records speak of long wars with the Assyrians. LJSpeech-1.1/mels/LJ046-0089.pt|His travel would be in secret; his public appearances would be behind bulletproof glass. A more practical approach necessitates compromise. LJSpeech-1.1/mels/LJ004-0110.pt|It was made incumbent upon the justices to provide distinct places of confinement for five classes of prisoners, viz. LJSpeech-1.1/mels/LJ032-0091.pt|There is no "Dr. Hideel" licensed to practice medicine in Louisiana. LJSpeech-1.1/mels/LJ038-0171.pt|General Walker gave this information to the police before the shooting, but it did not help solve the crime. LJSpeech-1.1/mels/LJ034-0159.pt|The Commission, therefore, does not base its conclusion concerning the identity of the assassin LJSpeech-1.1/mels/LJ018-0375.pt|The 'Lennie's' men were all Greeks, except one known as French Peter, LJSpeech-1.1/mels/LJ004-0113.pt|It was further ordered that male prisoners should be kept perfectly distinct from the females. LJSpeech-1.1/mels/LJ030-0250.pt|Other Secret Service agents assigned to the motorcade remained at their posts during the race to the hospital. LJSpeech-1.1/mels/LJ035-0011.pt|a strong wind blowing from the north almost unseated him. LJSpeech-1.1/mels/LJ037-0161.pt|and impressed upon the lead of the bullets inconsistent individual characteristics which made identification impossible. LJSpeech-1.1/mels/LJ034-0156.pt|whether or not he could positively identify the man he saw in the sixth-floor window as the same man he saw in the police station, LJSpeech-1.1/mels/LJ003-0108.pt|Spirits were freely introduced, and although he at first abstained, LJSpeech-1.1/mels/LJ048-0074.pt|To insure adequate and effective liaison arrangements, LJSpeech-1.1/mels/LJ031-0188.pt|Members of the Presidential and Vice-Presidential parties filled the central compartment of the plane to witness the swearing in. LJSpeech-1.1/mels/LJ018-0232.pt|He himself prepared it on a blank form which he had brought with him on purpose. LJSpeech-1.1/mels/LJ029-0125.pt|The only practical way for westbound traffic on Main Street LJSpeech-1.1/mels/LJ017-0196.pt|The last time Mrs. Soames showed great reluctance to take it, but Wilson said it would certainly do her good. LJSpeech-1.1/mels/LJ030-0152.pt|Speed of the Limousine LJSpeech-1.1/mels/LJ004-0238.pt|Mr. Buxton mentions the case of a boy whose apparent innocence and artlessness had attracted his attention. LJSpeech-1.1/mels/LJ032-0237.pt|it was established that the photographs must have been taken sometime after March twenty-seven. LJSpeech-1.1/mels/LJ024-0130.pt|to frighten the workers of America in a pay-envelope propaganda against the Social Security Law. LJSpeech-1.1/mels/LJ044-0129.pt|and often it is advisable for some people to remain in the background, not underground, end quote. LJSpeech-1.1/mels/LJ039-0124.pt|End quote. Major Anderson concluded, quote, I would say that as compared to other Marines receiving the same type of training, LJSpeech-1.1/mels/LJ025-0167.pt|and in the seeds which it produces are exactly equivalent to the weights of the same elements which have disappeared from the materials supplied to the bean during its growth. LJSpeech-1.1/mels/LJ042-0033.pt|of his concomitant hatred of the United States, which was most clearly expressed in his November twenty-six, LJSpeech-1.1/mels/LJ046-0228.pt|the Secret Service had no standard procedure for the systematic review of its requests for and receipt of information from other Federal agencies. LJSpeech-1.1/mels/LJ039-0159.pt|The ammunition used by the assassin was manufactured by Western Cartridge Co. of East Alton, Illinois. LJSpeech-1.1/mels/LJ028-0104.pt|lined the shores of the rivers with embankments, and spanned the rivers with bridges. LJSpeech-1.1/mels/LJ023-0102.pt|subsistence, and health of large numbers in the community, then LJSpeech-1.1/mels/LJ041-0136.pt|was shooting at Connally rather than President Kennedy, end quote. LJSpeech-1.1/mels/LJ045-0129.pt|has visited us here in Dallas, Texas, on November one. Agent James P. Hasty LJSpeech-1.1/mels/LJ022-0115.pt|This is a great national crusade to destroy enforced idleness which is an enemy of the human spirit LJSpeech-1.1/mels/LJ047-0087.pt|According to the Bureau, quote, LJSpeech-1.1/mels/LJ005-0242.pt|In the year immediately preceding this, Parliament was too busy with the great question of its own reform to spare much time for domestic legislation. LJSpeech-1.1/mels/LJ032-0252.pt|Marina Oswald has stated that the rifle was among these possessions, although Ruth Paine testified that she was not aware of it. LJSpeech-1.1/mels/LJ044-0225.pt|It should also be noted, however, that one witness testified that shortly before the assassination LJSpeech-1.1/mels/LJ018-0085.pt|He would shoot any man or any policeman like a dog, or any number of them, who had treated him in that way. LJSpeech-1.1/mels/LJ014-0105.pt|He was lying on his face, his legs tied up to his hips so as to allow of the body fitting into the hole. LJSpeech-1.1/mels/LJ012-0290.pt|While conversing with Mrs. Brown, he declared the unfortunate woman was rocking herself to and fro in a chair; LJSpeech-1.1/mels/LJ028-0505.pt|It seems that the bricks of the reliefs were molded and glazed separately and so accurately that when built into the wall they fitted perfectly. LJSpeech-1.1/mels/LJ036-0068.pt|Both buses stopped within one block of the Depository Building. LJSpeech-1.1/mels/LJ018-0011.pt|About the same time a body was discovered on the line near the railway-bridge by Victoria Park. LJSpeech-1.1/mels/LJ050-0267.pt|between Secretary Dillon and Donald F. Hornig, Special Assistant to the President for Science and Technology, is a useful effort in the right direction. LJSpeech-1.1/mels/LJ043-0041.pt|Consistent with this attitude LJSpeech-1.1/mels/LJ039-0171.pt|On the second series they required five point one five, six point four five, and seven seconds. LJSpeech-1.1/mels/LJ047-0084.pt|and his application was approved on the following day. LJSpeech-1.1/mels/LJ013-0088.pt|the cashier gave them eight Bank of England notes for one thousand pounds each, saying that they could get so much specie nowhere else. LJSpeech-1.1/mels/LJ032-0001.pt|Report of the President's Commission on the Assassination of President Kennedy. The Warren Commission Report. By The President's Commission on the Assassination of President Kennedy. LJSpeech-1.1/mels/LJ018-0125.pt|Burnett had only just come out of jail after completing a sentence of penal servitude. LJSpeech-1.1/mels/LJ005-0218.pt|The chapel still continued incommodious and insufficient LJSpeech-1.1/mels/LJ022-0082.pt|In all cases projects must be of a character to give employment to those on the relief rolls. LJSpeech-1.1/mels/LJ042-0201.pt|He wrote, quote, The Communist Party of the United States has betrayed itself! LJSpeech-1.1/mels/LJ002-0069.pt|to the various wards their friends occupied. LJSpeech-1.1/mels/LJ023-0133.pt|judges who will retain in the courts the judicial functions of a court, LJSpeech-1.1/mels/LJ044-0239.pt|and raises serious questions as to whether or not he ever expected to escape. LJSpeech-1.1/mels/LJ007-0186.pt|the undue authority given to prisoners, the levying of garnish under another name LJSpeech-1.1/mels/LJ009-0078.pt|who preaches plain, homely discourses, as fit as any religious discourse can be fit for the irritated audience. LJSpeech-1.1/mels/LJ010-0311.pt|in other words, he forged powers of attorney, and proceeded to realize securities lodged in his bank under various names. LJSpeech-1.1/mels/LJ015-0159.pt|In his person he was neat and fastidious; LJSpeech-1.1/mels/LJ016-0322.pt|the commission recommended that death sentences should be carried out within the jail, under such regulations as might be considered necessary LJSpeech-1.1/mels/LJ038-0223.pt|from October nine, nineteen sixty-two, to May fourteen, nineteen sixty-three. LJSpeech-1.1/mels/LJ016-0016.pt|There is an attempt at escape mentioned in Mr. Wakefield's book, which might have been an intended suicide. LJSpeech-1.1/mels/LJ024-0091.pt|Each one is radically different from the other. LJSpeech-1.1/mels/LJ021-0116.pt|We also question the wisdom of extending code requirements suited to the great industrial centers and to large employers, LJSpeech-1.1/mels/LJ031-0033.pt|Then he experienced his first sensation of pain, which became excruciating. LJSpeech-1.1/mels/LJ018-0377.pt|Conviction was obtained through the evidence of the steward and two of the least culpable of the crew. LJSpeech-1.1/mels/LJ012-0082.pt|Jordan and Sullivan, who at once set to work in a business-like way to obtain impressions of the keys of the strong room and chest. LJSpeech-1.1/mels/LJ015-0026.pt|Moreover, the partners were sober, steady men, who paid unremitting attention to business. LJSpeech-1.1/mels/LJ045-0039.pt|His past relationships with his wife had been stormy, however, and it did not seem that she respected him very much. LJSpeech-1.1/mels/LJ030-0073.pt|Presidential follow-up car. LJSpeech-1.1/mels/LJ025-0045.pt|They get rid of the superfluous hydrogen and carbon and accumulate nitrogen. LJSpeech-1.1/mels/LJ005-0204.pt|Clun, in Shropshire, had a lock-up under the town hall. LJSpeech-1.1/mels/LJ001-0024.pt|But the first Bible actually dated (which also was printed at Maintz by Peter Schoeffer in the year fourteen sixty-two) LJSpeech-1.1/mels/LJ026-0111.pt|In the cells the foods undergo metabolic changes. LJSpeech-1.1/mels/LJ010-0109.pt|Thistlewood made a long and rambling defense, the chief features of which were abuse of Lord Sidmouth, and the vilification of the informer Edwards. LJSpeech-1.1/mels/LJ038-0188.pt|two. Send the information as to what has happened to me to the Embassy. LJSpeech-1.1/mels/LJ012-0139.pt|Solomons, had sold bar gold to the value of one thousand two hundred pounds to certain bullion dealers. LJSpeech-1.1/mels/LJ019-0112.pt|Such excellent returns might be counted upon, that a margin of profit would be left after the cost of the prisons had been defrayed. LJSpeech-1.1/mels/LJ033-0107.pt|No other employee has been found who saw Oswald enter that morning. LJSpeech-1.1/mels/LJ042-0189.pt|but one with union communes, LJSpeech-1.1/mels/LJ018-0079.pt|The unfortunate man survived till he landed, but died in Guy's Hospital. LJSpeech-1.1/mels/LJ035-0040.pt|As Baker reached the second floor, he was about twenty feet from the vestibule door. He intended to continue around to his left toward the stairway going up LJSpeech-1.1/mels/LJ046-0163.pt|During the period November nineteen sixty-one to November nineteen sixty-three, LJSpeech-1.1/mels/LJ038-0103.pt|On the afternoon of November twenty-three, Officers H. M. Moore, LJSpeech-1.1/mels/LJ014-0247.pt|and without reference to or comparison with the documents in which the payment was claimed. LJSpeech-1.1/mels/LJ037-0225.pt|five foot eight inches, black hair, slender, wearing a white jacket, white shirt and dark slacks, end quote, LJSpeech-1.1/mels/LJ010-0119.pt|It was asserted, not without foundation, at these trials, that Edwards repeatedly incited the associates he was betraying LJSpeech-1.1/mels/LJ018-0037.pt|In searching the prisoner's box, Mr. Briggs' watch was found wrapped up in a piece of leather, LJSpeech-1.1/mels/LJ033-0173.pt|The papers I also found were similar in fiber composition, therefore, in addition to the visual characteristics, LJSpeech-1.1/mels/LJ012-0113.pt|After their arrest, Jordan's wife and Sullivan's brother came to the inn, and begged to be allowed to visit this room; LJSpeech-1.1/mels/LJ030-0004.pt|The trip to Texas began with the departure of President and Mrs. Kennedy from the White House LJSpeech-1.1/mels/LJ042-0090.pt|I'm sure Russians will accept me after this sign of my faith in them, end quote. LJSpeech-1.1/mels/LJ044-0203.pt|For example, the Dallas Times Herald of November nineteen, nineteen sixty-three, LJSpeech-1.1/mels/LJ012-0243.pt|There were many features of resemblance in these crimes. LJSpeech-1.1/mels/LJ008-0247.pt|but ever the same form moved along in the fulfillment of his mission, in spite of all persecution. LJSpeech-1.1/mels/LJ005-0258.pt|embodying recommendations which may be said to have formed the basis of modern prison management. LJSpeech-1.1/mels/LJ017-0064.pt|he made use of the remarkable words, quote, If it is necessary for my soul's sake to confess this murder, LJSpeech-1.1/mels/LJ016-0188.pt|He told Calcraft that he was Foxen the executioner, and that he was that moment on his way to Newgate to hang a man, LJSpeech-1.1/mels/LJ048-0190.pt|If such instructions were in fact given, they were not effectively carried out. LJSpeech-1.1/mels/LJ037-0197.pt|and the return address was Post Office Box two nine one five, Dallas, Texas. LJSpeech-1.1/mels/LJ025-0077.pt|Their food is provided for them, LJSpeech-1.1/mels/LJ030-0217.pt|quote, Mrs. Kennedy had jumped up from the seat and was, it appeared to me, reaching for something coming off the fight rear bumper of the car, LJSpeech-1.1/mels/LJ005-0175.pt|At this time there were in England one hundred and seventy boroughs, cities, towns, and liberties LJSpeech-1.1/mels/LJ006-0182.pt|Under the reckless contempt for regulations, LJSpeech-1.1/mels/LJ019-0302.pt|In eighteen sixty-two there were in all one hundred and ninety-three jails in England and Wales; LJSpeech-1.1/mels/LJ036-0202.pt|At twelve:fifty-four p.m., Tippit reported that he was in the central Oak Cliff area at Lancaster and Eighth. LJSpeech-1.1/mels/LJ018-0083.pt|Sattler was a very excitable although not an ill-tempered man. LJSpeech-1.1/mels/LJ032-0207.pt|I found it to be the same general configuration. All appearances were the same, end quote, LJSpeech-1.1/mels/LJ015-0018.pt|and dated back to the Commonwealth, when, under the title of Snow and Walton, it carried on business as pawnbrokers. LJSpeech-1.1/mels/LJ035-0089.pt|No allowance was made for the special conditions which existed on the day of the assassination LJSpeech-1.1/mels/LJ012-0094.pt|While the excitement was still fresh, a new robbery of diamonds was committed at a bonded warehouse in the immediate neighborhood, on Custom House Quay. LJSpeech-1.1/mels/LJ045-0004.pt|It has been suggested that one of the motivating influences operating on Lee Oswald was the atmosphere in the city of Dallas, LJSpeech-1.1/mels/LJ030-0036.pt|Secret Service arrangements for Presidential trips, which were followed in the Dallas motorcade, LJSpeech-1.1/mels/LJ010-0307.pt|New liabilities were incurred to the extent of one hundred thousand pounds by more failures, and in eighteen nineteen, LJSpeech-1.1/mels/LJ024-0038.pt|that no President fit for his office would appoint, LJSpeech-1.1/mels/LJ008-0301.pt|during which they counted the moments -- the prisoners in their cells as usual, and their friends in the street in front of Newgate, where they passed the night. LJSpeech-1.1/mels/LJ028-0073.pt|The walls of the palaces of many of the Assyrian kings were lined with great stone slabs engraved with reliefs and sometimes with the portrait of a king. LJSpeech-1.1/mels/LJ019-0022.pt|On the other hand, it must be admitted LJSpeech-1.1/mels/LJ001-0109.pt|this is best furthered by the avoidance of irrational swellings and spiky projections, and by the using of careful purity of line. LJSpeech-1.1/mels/LJ041-0149.pt|He told Aline Mosby, a reporter who interviewed him after he arrived in Moscow, quote, LJSpeech-1.1/mels/LJ028-0092.pt|Read the introduction to any of his inscriptions, of which the following is one, and you will call him vain and proud, LJSpeech-1.1/mels/LJ002-0073.pt|Neild takes it for granted that the former rather than the latter prevailed in the selection, LJSpeech-1.1/mels/LJ042-0178.pt|He thought the new alternative would have its best chance to be accepted after, quote, conflict between the two world systems leaves the world country LJSpeech-1.1/mels/LJ045-0224.pt|and such a favorable opportunity to strike at a figure as great as the President would probably never have come to him again. LJSpeech-1.1/mels/LJ021-0105.pt|and the vital necessity of improving labor conditions, LJSpeech-1.1/mels/LJ017-0142.pt|Smethurst's escape may have influenced the jury in the Poplar poisoning case, LJSpeech-1.1/mels/LJ005-0115.pt|or an imaginary boundary line, and nothing prevented parties from passing to either side LJSpeech-1.1/mels/LJ039-0038.pt|throughout April. The Commission asked Marina Oswald whether she might have misunderstood the object of her husband's threat. She stated, quote, LJSpeech-1.1/mels/LJ005-0005.pt|Even then they were not certain of the favor, for I find a reference to a decent and respectable woman sent to Newgate LJSpeech-1.1/mels/LJ029-0057.pt|nineteen sixty-three, Lawson inquired about the incident and obtained through the local police photographs of some of the persons involved. LJSpeech-1.1/mels/LJ003-0013.pt|No attempt was made to check drunkenness, beyond the penalty of shutting out friends from any ward in which a prisoner exceeded. LJSpeech-1.1/mels/LJ024-0081.pt|But we cannot yield our constitutional destiny to the personal judgment of a few men who, being fearful of the future, LJSpeech-1.1/mels/LJ028-0068.pt|They tell how he forced the exiles to carry heavy bags of sand across the desert to increase their burdens; LJSpeech-1.1/mels/LJ005-0200.pt|Most of these small jails were still in existence and in much the same state eight years later, LJSpeech-1.1/mels/LJ031-0082.pt|From a medical viewpoint, President Kennedy was alive when he arrived at Parkland Hospital; LJSpeech-1.1/mels/LJ032-0270.pt|Having reviewed the evidence that (one) Lee Harvey Oswald purchased the rifle used in the assassination, LJSpeech-1.1/mels/LJ024-0109.pt|Now they are making a last stand. LJSpeech-1.1/mels/LJ023-0087.pt|the majority of the Court has been assuming the power to pass on the wisdom of these acts of the Congress LJSpeech-1.1/mels/LJ043-0115.pt|He lost his job on July nineteen, nineteen sixty-three, because his work was not satisfactory LJSpeech-1.1/mels/LJ010-0037.pt|Now and again there seemed to be a recurrence of a murder epidemic, LJSpeech-1.1/mels/LJ035-0045.pt|Baker said, quote, He [Truly] had already started around the bend to come to the next elevator going up, LJSpeech-1.1/mels/LJ013-0099.pt|A smart detective, Forrester, after a little inquiry, LJSpeech-1.1/mels/LJ050-0046.pt|it has obtained the services of outside consultants, such as the Rand Corporation, LJSpeech-1.1/mels/LJ032-0035.pt|In addition to the order coupon the envelope contained a. U.S. postal money order for twenty-one dollars, forty-five cents, LJSpeech-1.1/mels/LJ033-0162.pt|from the shipping room of the Depository and forwarded it to the FBI Laboratory in Washington. LJSpeech-1.1/mels/LJ029-0141.pt|from Main across Elm to the access road to Stemmons Freeway and the Dallas-Fort Worth Turnpike. LJSpeech-1.1/mels/LJ019-0127.pt|or the still more costly process of walling in the whole farm, would have greatly added to the charges of these establishments. LJSpeech-1.1/mels/LJ032-0013.pt|and killing Patrolman Tippit, LJSpeech-1.1/mels/LJ007-0069.pt|While admitting that he had had many difficulties to contend with, LJSpeech-1.1/mels/LJ049-0006.pt|These precautions included reserving a ceremonial area for the Presidential party, LJSpeech-1.1/mels/LJ029-0169.pt|so that crowds can get a good view of President Kennedy and his wife. LJSpeech-1.1/mels/LJ011-0205.pt|he carried me away by fraud and stratagem, and forced me to accompany him to Gretna Green LJSpeech-1.1/mels/LJ039-0170.pt|and eight point two five seconds respectively. LJSpeech-1.1/mels/LJ015-0048.pt|But worse than the bankruptcy was the confession made by the partners in the court. LJSpeech-1.1/mels/LJ046-0052.pt|To promote nationwide acceptance of his administration Washington made grand tours that served also to excite interest in the Presidency. LJSpeech-1.1/mels/LJ033-0058.pt|On the day of the assassination, Marina Oswald was watching television when she learned of the shooting. LJSpeech-1.1/mels/LJ046-0240.pt|Bouck explained the failure to try to identify the individuals involved in the Stevenson incident after it occurred on the ground that LJSpeech-1.1/mels/LJ008-0003.pt|which we left at the time of the discontinuance of the long-practiced procession to Tyburn. LJSpeech-1.1/mels/LJ015-0020.pt|he was a man esteemed and respected in society and the world of finance, incapable as it was thought of a dishonest deed. LJSpeech-1.1/mels/LJ049-0058.pt|Secondly, agents are instructed to remove the President as quickly as possible from known or impending danger. LJSpeech-1.1/mels/LJ050-0207.pt|Although Chief Rowley does not complain about the pay scale for Secret Service agents, LJSpeech-1.1/mels/LJ011-0222.pt|He also wrote and published a pamphlet from the jail to show that Miss Turner had been a consenting party to the marriage, and was really his wife. LJSpeech-1.1/mels/LJ045-0085.pt|Why don't you make some money? Poor guy was going out of his mind. We told her she should not annoy him -- poor guy, he is doing his best, "Don't annoy him so much." LJSpeech-1.1/mels/LJ009-0154.pt|Mr. Charles Kean the tragedian was also present, LJSpeech-1.1/mels/LJ002-0016.pt|Previous to that date there had been seven hundred or eight hundred frequently, and once, in Mr. Akerman's time, one thousand. LJSpeech-1.1/mels/LJ008-0118.pt|"Thank you, sir," said the governor to the doctor, "it is of little moment." LJSpeech-1.1/mels/LJ006-0142.pt|The matron deposed to having seen the gates-woman "exceedingly drunk," and having been insulted by her. LJSpeech-1.1/mels/LJ008-0155.pt|Very great excitement prevailed in the town throughout the trial, and this greatly increased when the verdict was known. LJSpeech-1.1/mels/LJ003-0153.pt|Idleness was not so universally the rule in this part of the jail. LJSpeech-1.1/mels/LJ027-0062.pt|viz., the brain; and also usually, but not always, a number of posterior joints, LJSpeech-1.1/mels/LJ010-0028.pt|The causes also continued much the same. Passion, revenge, cupidity, sudden ebullitions of homicidal rage, LJSpeech-1.1/mels/LJ019-0183.pt|provided it was henceforth used only for untried prisoners, suggested that Newgate should be entirely reconstructed, and the new building adopted as a model. LJSpeech-1.1/mels/LJ015-0160.pt|he patronized the best tailors, and had a fashionable coiffeur from Hanover Square daily to curl his hair. LJSpeech-1.1/mels/LJ008-0313.pt|who in solemn tones communicated to each in turn the fate in store for him. LJSpeech-1.1/mels/LJ020-0053.pt|in the form of turnovers, pinching the corners of the fold pretty hard to hinder the flap of dough from flying up as the rising proceeds. LJSpeech-1.1/mels/LJ024-0026.pt|and the rules of many of our universities and of almost every great private business enterprise, LJSpeech-1.1/mels/LJ026-0046.pt|In each the life is the sum total of a series of definite processes -- nutrition or food supply, LJSpeech-1.1/mels/LJ049-0165.pt|which first appeared in the appropriation of the Department of Justice in nineteen ten under the heading, quote, Miscellaneous Objects, end quote. LJSpeech-1.1/mels/LJ039-0077.pt|Well, in order to achieve three hits, it would not be required that a man be an exceptional shot. A proficient man with this weapon, yes, end quote. LJSpeech-1.1/mels/LJ048-0219.pt|who must concentrate primarily on the possibility of threats from crowds along the route, provide a significant safeguard against dangers in nearby buildings. LJSpeech-1.1/mels/LJ018-0135.pt|and in the states known as "water-leaf" and "sized," which are the penultimate processes of manufacture. LJSpeech-1.1/mels/LJ014-0057.pt|London did not escape the contagion, and prominent among the detestable crimes of the period stands that of the Mannings at Bermondsey. LJSpeech-1.1/mels/LJ040-0220.pt|could have led anyone to predict the outburst of violence which finally occurred. LJSpeech-1.1/mels/LJ013-0037.pt|The crime of fraudulent insurance they declared was very common, and the underwriters must have lost great sums in this way. LJSpeech-1.1/mels/LJ050-0231.pt|Before the assassination the Secret Service infrequently requested other Federal law enforcement agencies to provide personnel LJSpeech-1.1/mels/LJ011-0170.pt|Wakefield, in reply to her inquiries, satisfied her that her mother was well, and that the real reason for summoning her from school LJSpeech-1.1/mels/LJ007-0161.pt|drink, gaming, obscene and blasphemous language; utter idleness, the almost unrestricted admission of money and luxuries; LJSpeech-1.1/mels/LJ010-0149.pt|She was seized before she could do any mischief, LJSpeech-1.1/mels/LJ002-0100.pt|A recent reform had closed the tap kept by the jailer within the precincts, but LJSpeech-1.1/mels/LJ048-0020.pt|The interview with him in jail is not significant from the standpoint of whether he had a propensity for violence. LJSpeech-1.1/mels/LJ004-0165.pt|the visitors were furnished with candles, and they descended eighteen long steps into a vault. LJSpeech-1.1/mels/LJ021-0070.pt|Employed workers have not by any means all enjoyed a return to the earnings of prosperous times, LJSpeech-1.1/mels/LJ011-0202.pt|The uncle claimed her. The husband resisted. LJSpeech-1.1/mels/LJ019-0268.pt|In some places the dietary was too full, in others too meager. Its constituents were not of the most suitable character. LJSpeech-1.1/mels/LJ048-0043.pt|nor was there any requirement to report the names of defectors. However, there was much material in the hands of the FBI about Oswald: LJSpeech-1.1/mels/LJ012-0254.pt|where a workman found a bundle containing two human legs, in a drain. LJSpeech-1.1/mels/LJ011-0084.pt|After three years' confinement in the latter prison he passed himself off as his brother, Colonel Montgomery, LJSpeech-1.1/mels/LJ001-0154.pt|the result as measured by the eye being that the lower margin is less than the top one, and that the whole opening has an upside-down look vertically LJSpeech-1.1/mels/LJ036-0058.pt|People on the bus began talking about it. As the bus neared Lamar Street, Oswald left the bus and disappeared into the crowd. LJSpeech-1.1/mels/LJ007-0028.pt|there still remained one where the general callous indifference and mismanagement culminated in cruel culpable neglect. LJSpeech-1.1/mels/LJ048-0221.pt|In the early morning hours on November twenty-two, nineteen sixty-three, LJSpeech-1.1/mels/LJ004-0139.pt|"In the morning the stench and heat were so oppressive that he and every one else on waking rushed unclothed into the yard;" LJSpeech-1.1/mels/LJ016-0360.pt|The change added greatly to the responsibilities of the governor and his subordinates. Hitherto the public had seemed to assist at the ceremony; LJSpeech-1.1/mels/LJ027-0143.pt|whereby the primitive horn was gradually superseded by horns presenting a greater and greater number of prongs in successive species of extinct deer. LJSpeech-1.1/mels/LJ043-0159.pt|Answer: Yes. LJSpeech-1.1/mels/LJ005-0027.pt|He was altogether against too liberal a diet; he disapproved of industrial occupations in jails, as not calculated to render prisons terrible. LJSpeech-1.1/mels/LJ020-0033.pt|It will not swell so fast as the white, so give yourself more time for making it. LJSpeech-1.1/mels/LJ028-0194.pt|But how did the "mighty city" fall? How could Cyrus take Babylon whose walls were strong enough to resist any army? LJSpeech-1.1/mels/LJ017-0081.pt|sought about for a fresh victim to supply him with funds. LJSpeech-1.1/mels/LJ028-0443.pt|because great masses of masonry used to project from its surface. LJSpeech-1.1/mels/LJ019-0297.pt|The prisoners inter-communicated freely, and exercised the most injurious, corrupting influences upon one another. LJSpeech-1.1/mels/LJ035-0189.pt|Special Agent Forrest V. Sorrels of the Secret Service, who had been in the motorcade, LJSpeech-1.1/mels/LJ012-0265.pt|A woman named Gale, who lived with him, was arrested at the same time. The prisoners were examined at the Marylebone police court. LJSpeech-1.1/mels/LJ041-0072.pt|that he was a man of great ability and intelligence and that many of his superiors in the Marine Corps were not sufficiently competent to give him orders. LJSpeech-1.1/mels/LJ030-0034.pt|Approximately ten minutes after the arrival at Love Field, the President and Mrs. Kennedy went to the Presidential automobile to begin the motorcade. LJSpeech-1.1/mels/LJ003-0349.pt|Why not relieve Newgate by drawing more largely upon the superior accommodation which Millbank offered? LJSpeech-1.1/mels/LJ040-0173.pt|He always felt like a burden that she simply just had to tolerate, end quote. LJSpeech-1.1/mels/LJ036-0145.pt|However, Neches and Beckley do not intersect. LJSpeech-1.1/mels/LJ014-0152.pt|On reaching the condemned cell she threw herself upon the floor and shrieked in an hysterical agony of tears. LJSpeech-1.1/mels/LJ015-0263.pt|Scarcely had the conviction of these daring and astute thieves been assured, than another gigantic fraud was brought to light. LJSpeech-1.1/mels/LJ019-0254.pt|they were frequently below the standard size, and were therefore not certified for occupation as was required by law. LJSpeech-1.1/mels/LJ030-0192.pt|What are they doing to you! end quote. Looking back from the front seat, LJSpeech-1.1/mels/LJ007-0003.pt|and Mrs. Fry with her colleagues still labored assiduously in Newgate, devoting themselves mainly to the female prison, LJSpeech-1.1/mels/LJ046-0248.pt|to Federal intelligence and law enforcement agencies were not well designed to elicit information from them LJSpeech-1.1/mels/LJ048-0025.pt|and had told Mrs. Paine that when he got the money he was going to take an apartment, when the baby was old enough, he was going to take an apartment, and the family would live together. LJSpeech-1.1/mels/LJ044-0235.pt|If there was no conspiracy which would help him escape, the possibility of which has been considered in chapter six, LJSpeech-1.1/mels/LJ026-0049.pt|In turn these will be compared for the animal and the plant, LJSpeech-1.1/mels/LJ040-0051.pt|While there is doubt about how fully Oswald understood the doctrine which he so often espoused, it seems clear LJSpeech-1.1/mels/LJ016-0109.pt|but not till they had had an exciting chase down the street. LJSpeech-1.1/mels/LJ003-0092.pt|There were frequently in the middle yard seven or eight children, the youngest barely nine, LJSpeech-1.1/mels/LJ028-0074.pt|But in Babylonia stone was difficult to obtain, and sculptures were very rare. LJSpeech-1.1/mels/LJ033-0108.pt|In deciding whether Oswald carried the assassination weapon in the bag which Frazier and Mrs. Randle saw, LJSpeech-1.1/mels/LJ047-0083.pt|The Passport Office of the Department of State in Washington had no listing for Oswald requiring special treatment, LJSpeech-1.1/mels/LJ022-0108.pt|For many months preparations have been under way. LJSpeech-1.1/mels/LJ008-0064.pt|When the criminals are tied up and prepared for their fate, this floor suddenly falls down, upon withdrawing the supporters inwards. LJSpeech-1.1/mels/LJ034-0141.pt|and he said that the shots came from inside the building, end quote. LJSpeech-1.1/mels/LJ015-0216.pt|This was an important step, and they might easily be robbed some day when Burgess was the guard, provided only that they could be opened. LJSpeech-1.1/mels/LJ047-0007.pt|It had interviewed him twice shortly after his return to the United States, again a year later at his request LJSpeech-1.1/mels/LJ002-0190.pt|The best, or at least the most influential prisoners, got lodging in the State House, which contained "eight large handsome rooms." LJSpeech-1.1/mels/LJ031-0083.pt|the doctors observed that he had a heartbeat and was making some respiratory efforts. LJSpeech-1.1/mels/LJ044-0196.pt|to a country in which he must have thought were embodied the political principles to which he had been committed for so long. LJSpeech-1.1/mels/LJ009-0017.pt|For this the chaplain was a few days later summoned before the jail committee of aldermen, LJSpeech-1.1/mels/LJ004-0057.pt|For the first time the doctrine was enunciated that prisoners had rights of their own. LJSpeech-1.1/mels/LJ005-0126.pt|Religious worship became more generally the rule; chaplains were appointed, and chapels provided for them; surgeons and hospitals also. LJSpeech-1.1/mels/LJ036-0025.pt|McWatters was sure that he left the checkpoint on time LJSpeech-1.1/mels/LJ022-0152.pt|There is likewise pending before the Congress LJSpeech-1.1/mels/LJ002-0142.pt|These courts were open to many and grave objections. LJSpeech-1.1/mels/LJ034-0165.pt|Lee Harvey Oswald. LJSpeech-1.1/mels/LJ040-0130.pt|and interviewed and observed by other members of the Youth House staff. LJSpeech-1.1/mels/LJ044-0114.pt|he received a letter from somebody in New York, some Communist -- probably from New York -- I am not sure from where -- from some Communist leader and he was very happy, LJSpeech-1.1/mels/LJ031-0212.pt|The body was muscular and well developed with no gross skeletal abnormalities except for those caused by the gunshot wounds. LJSpeech-1.1/mels/LJ016-0041.pt|and working with his hands behind him, while he used his bare feet like claws upon the other side of the wall angle. LJSpeech-1.1/mels/LJ005-0173.pt|I shall not hesitate to ask Parliament for powers to compel them to make the necessary alterations, for it is not to be endured that these local jurisdictions should remain LJSpeech-1.1/mels/LJ014-0332.pt|Cole escaped by throwing the blame on a careless partner, and at once removed the "stop." LJSpeech-1.1/mels/LJ010-0143.pt|This axe is still in existence, and is preserved at Newgate with various other unpleasant curiosities, LJSpeech-1.1/mels/LJ035-0066.pt|In an effort to determine whether Oswald could have descended to the lunchroom LJSpeech-1.1/mels/LJ016-0335.pt|There was no interference with the crowd, which collected as usual, although not to the customary extent. LJSpeech-1.1/mels/LJ029-0067.pt|nor did PRS develop any additional information between November twelve, when Lawson left Washington, and November twenty-two. LJSpeech-1.1/mels/LJ048-0115.pt|to determine what matters require attention in making advance preparations and to decide what action to take. LJSpeech-1.1/mels/LJ005-0183.pt|All that was urged was that the borough magistracy had no right to govern their jails LJSpeech-1.1/mels/LJ014-0134.pt|that O'Connor had been more to her than her husband, that she ought to have married him. LJSpeech-1.1/mels/LJ018-0093.pt|As a blind for their new frauds, they set up as law-stationers in York Buildings, Adelphi, and at once commenced their nefarious traffic. LJSpeech-1.1/mels/LJ006-0052.pt|The sum total thus produced was inconsiderable compared with the hundreds that had formerly filled the jail, LJSpeech-1.1/mels/LJ033-0081.pt|she looked out the breakfast-room window and saw Oswald cross the street and walk toward the driveway where her brother parked his car near the carport. LJSpeech-1.1/mels/LJ012-0010.pt|both having been recognized by the clergyman who had performed the ceremony, and the assault had been committed to secure the money LJSpeech-1.1/mels/LJ008-0267.pt|no less than four hundred and fifty-one sentences of death for capital crimes were passed at the Old Bailey; LJSpeech-1.1/mels/LJ025-0086.pt|and the few and exceptional cases of non-parasitic animals which do not feed at all. LJSpeech-1.1/mels/LJ005-0132.pt|Only a few glaring evils still demanded a remedy. LJSpeech-1.1/mels/LJ004-0213.pt|Compared with those highly meritorious institutions Newgate still showed but badly. LJSpeech-1.1/mels/LJ003-0206.pt|and their gibes and jollity counteracted the ordinary's counsels or the independent preacher's earnest prayers. LJSpeech-1.1/mels/LJ030-0243.pt|but I had no time to speculate as to its origin because Agent Youngblood turned in a flash, immediately after the first explosion, LJSpeech-1.1/mels/LJ015-0228.pt|Pierce boldly stepped in, found the cupboard unlocked; he removed the key, handed it to Agar outside, LJSpeech-1.1/mels/LJ032-0171.pt|and that this was the same shirt which Oswald wore on the morning of the assassination. LJSpeech-1.1/mels/LJ028-0418.pt|About that same time Pietro della Valle, an Italian, visited Babylon, LJSpeech-1.1/mels/LJ032-0074.pt|The mail-order coupon listed the purchaser as "A. J. Hidell Age twenty-eight" LJSpeech-1.1/mels/LJ036-0209.pt|A similar description was given on channel two at twelve:forty-five p.m. LJSpeech-1.1/mels/LJ009-0300.pt|Traveling expenses of these agents cost fifteen pounds, and another ten pounds were spent in the hire of a Shropshire man, LJSpeech-1.1/mels/LJ004-0112.pt|three. Prisoners guilty of misdemeanors. four. Prisoners charged with misdemeanors. five. Debtors. LJSpeech-1.1/mels/LJ036-0098.pt|William Whaley, a taxicab driver, told his employer on Saturday morning, November twenty-three LJSpeech-1.1/mels/LJ032-0200.pt|One Sunday, while his wife was hanging diapers, Oswald asked her to take a picture of him holding a rifle, a pistol LJSpeech-1.1/mels/LJ008-0174.pt|One cart-load of spectators having broken down, some of its occupants fell off the vehicle, and were instantly trampled to death. LJSpeech-1.1/mels/LJ006-0120.pt|by drawing briefs and petitions for his fellows. There was a recognized charge of five shillings per brief, LJSpeech-1.1/mels/LJ018-0264.pt|Roupell was quiet and submissive while in Newgate, unassuming in manner, and ready to make the best of his position. LJSpeech-1.1/mels/LJ035-0086.pt|The time actually required for Baker and Truly to reach the second floor on November twenty-two was probably longer than in the test runs. For example, LJSpeech-1.1/mels/LJ038-0262.pt|Robert A. Frazier, an FBI ballistics identification expert, testified that he was, quote, unable to reach a conclusion, end quote, LJSpeech-1.1/mels/LJ019-0116.pt|anticipating the best results from a system which made earnings, and indeed release, dependent upon the amount of work done. LJSpeech-1.1/mels/LJ046-0036.pt|regarding certain protective measures in force at the time of the Dallas trip and propose recommendations for improvements. LJSpeech-1.1/mels/LJ033-0094.pt|As they sat in the car, Frazier asked Oswald where his lunch was, and Oswald replied that he was going to buy his lunch that day. LJSpeech-1.1/mels/LJ042-0027.pt|In addition to studying the Russian language while he was in the Marines, LJSpeech-1.1/mels/LJ006-0140.pt|Evidence was given before the inspectors of eight or ten prisoners seen "giddy drunk, not able to sit upon forms." LJSpeech-1.1/mels/LJ012-0138.pt|They also ascertained that a gold-refiner, LJSpeech-1.1/mels/LJ013-0207.pt|In this he gave as the motives of his crime a quarrel he had with his master, who threatened to discharge him without a character. LJSpeech-1.1/mels/LJ011-0032.pt|declared that they had hitherto formed a high opinion of his honor, integrity, and goodness of disposition, LJSpeech-1.1/mels/LJ019-0369.pt|In the same way, six months' notice was required in cases where the closing of a prison was contemplated; LJSpeech-1.1/mels/LJ016-0384.pt|when the first shock of the verdict and the solemn notification of the impending blow keeps nearly all awake, or at least disturbs their night's rest. LJSpeech-1.1/mels/LJ014-0034.pt|Hocker, whose skill in counterfeiting handwriting was known, was asked to fabricate a letter making an assignation with Delarue LJSpeech-1.1/mels/LJ003-0006.pt|Besides this, although the families of debtors were no longer permitted to live with them inside the jail, LJSpeech-1.1/mels/LJ043-0149.pt|where she had gone, contrary to his instructions, after she became, worried about his absence. LJSpeech-1.1/mels/LJ012-0006.pt|A watch was set on him at her house, where he was soon afterwards arrested. LJSpeech-1.1/mels/LJ042-0105.pt|he took the position that the Communist Party officials in the Soviet Union were opportunists who were betraying their positions for personal gain. LJSpeech-1.1/mels/LJ005-0219.pt|female prisoners were still exposed to the full view of the males, the netting in front of the gallery being perfectly useless as a screen. LJSpeech-1.1/mels/LJ040-0212.pt|The factors in Lee Oswald's personality which were noted by those who had contact with him in New York indicate LJSpeech-1.1/mels/LJ042-0205.pt|There can be no sympathy for those who have turned the idea of communism into a vile curse to Western man. LJSpeech-1.1/mels/LJ006-0066.pt|In the middle yard it was still worse. LJSpeech-1.1/mels/LJ003-0124.pt|He was charged with moving something which should not be touched, with leaving a door open, or coughing maliciously to the disturbance of his companions. LJSpeech-1.1/mels/LJ038-0009.pt|When he heard police sirens, he, quote, looked up and saw the man enter the lobby, end quote. LJSpeech-1.1/mels/LJ015-0303.pt|but on being searched, two blank cheques of the London and Westminster Bank were found in his pocket. LJSpeech-1.1/mels/LJ028-0373.pt|The Hebrew exiles, whose ancestors Nebuchadnezzar had brought from Jerusalem, LJSpeech-1.1/mels/LJ009-0183.pt|the site of the present Sessions House of the Old Bailey, and the operation was witnessed by students and a number of curious spectators. LJSpeech-1.1/mels/LJ044-0111.pt|for anybody who is concerned about developments in Cuba, end quote, LJSpeech-1.1/mels/LJ031-0065.pt|As a result of the infusion of liquids through the cutdowns, the cardiac massage, and the airway, LJSpeech-1.1/mels/LJ035-0139.pt|They reentered the building by the rear door several minutes after Baker and Truly rushed through the front entrance. LJSpeech-1.1/mels/LJ041-0105.pt|led to an incident in which he spilled a drink on one of his sergeants and abusively challenged him to fight. LJSpeech-1.1/mels/LJ050-0182.pt|Liaison With Local Law Enforcement Agencies LJSpeech-1.1/mels/LJ009-0198.pt|and her body publicly exhibited in a place built for the purpose in the Old Bailey. LJSpeech-1.1/mels/LJ004-0085.pt|As far back as the reign of Charles the second, a law was passed declaring that sufficient provision should be made for the relief and setting on work LJSpeech-1.1/mels/LJ027-0032.pt|Internal organs may persist unchanged and hence they offer good guides to classification. LJSpeech-1.1/mels/LJ026-0010.pt|Since they cannot be classified, it is necessary that they be listed both under botany and zoology, in order to make sure that they will not be omitted entirely. LJSpeech-1.1/mels/LJ009-0117.pt|The firmest disbeliever in religion, if he had not lately been irritated by taking part in such a scene as the condemned service in Newgate, LJSpeech-1.1/mels/LJ012-0272.pt|They were apparently good friends when last seen together at a neighbor's, where they seemed "perfectly happy and sociable, and eager for the wedding day." LJSpeech-1.1/mels/LJ005-0110.pt|and so passing by the roof down into the garden and on to freedom. LJSpeech-1.1/mels/LJ027-0096.pt|as, indeed, she must be according to the derivation theory. LJSpeech-1.1/mels/LJ038-0025.pt|Patrolman M. N. McDonald, with Patrolmen R. Hawkins, T. A. Hutson, and C. T. Walker, entered the theatre from the rear. LJSpeech-1.1/mels/LJ029-0202.pt|the president of the Dallas Chamber of Commerce referred to the city's reputation for being the friendliest town in America and asserted that citizens would, quote, LJSpeech-1.1/mels/LJ003-0044.pt|The reforms which were to be attempted in that prison LJSpeech-1.1/mels/LJ032-0146.pt|Latona testified that this palmprint was the right palmprint of Lee Harvey Oswald. LJSpeech-1.1/mels/LJ046-0219.pt|The above action should be taken without delay in order to attempt to verify the information and no evaluation of the information should be attempted. LJSpeech-1.1/mels/LJ015-0155.pt|that so good a man had really been for years a swindler and a rogue. LJSpeech-1.1/mels/LJ015-0307.pt|The evidence was corroborated by that of many of the victims who had acted as messengers, LJSpeech-1.1/mels/LJ023-0093.pt|Chief Justice Hughes said in a dissenting opinion that the majority opinion was "a departure from sound principles," LJSpeech-1.1/mels/LJ009-0111.pt|the condemned returning to the cells: the forger carried by turnkeys; the youth sobbing aloud convulsively, as a passionate child; LJSpeech-1.1/mels/LJ039-0100.pt|During the first week of an intensive eight-week training period he received instruction in sighting, aiming, and manipulation of the trigger. LJSpeech-1.1/mels/LJ047-0150.pt|West Fifth Street, Irving, Texas. After receiving this information on October twenty-nine, Agent Hosty attempted to locate Oswald. LJSpeech-1.1/mels/LJ034-0037.pt|Someone sitting on the box facing the window would have his palm in this position if he placed his hand alongside his right hip. LJSpeech-1.1/mels/LJ048-0008.pt|was his attempt on General Walker's life, which did not become known to the FBI until after the assassination. LJSpeech-1.1/mels/LJ043-0061.pt|at the time of his defection, when he evidenced no interest in his father and hardly mentioned him, even when questioned. LJSpeech-1.1/mels/LJ026-0107.pt|Dissolved in water, the sugar is transported down delicate tubes, chiefly in the growing bark region of the stem. LJSpeech-1.1/mels/LJ048-0242.pt|Three members of this shift separately took this opportunity to visit the Cellar Coffee House. LJSpeech-1.1/mels/LJ012-0104.pt|The thieves were satisfied with the diamonds; they broke open other cases containing gold watches and plate, but abstracted nothing. LJSpeech-1.1/mels/LJ003-0173.pt|He continued the ancient practice of letting out a portion of his own house, and by a poetical fiction treated it as an annex of the state side. LJSpeech-1.1/mels/LJ037-0221.pt|He was wearing a zipper jacket which he had not been wearing moments before when he had arrived home. LJSpeech-1.1/mels/LJ048-0201.pt|I stressed the fact that this was our President and he should be shown every respect due his position and that it was our duty to see that this was done. LJSpeech-1.1/mels/LJ003-0237.pt|The fees on reception and discharge must be deemed exorbitant, when it is remembered the impoverished class who usually crowded the jail; LJSpeech-1.1/mels/LJ017-0092.pt|He decided to use strychnia, or the vegetable poison otherwise known as nux vomica; LJSpeech-1.1/mels/LJ042-0190.pt|democratic socializing of production, and without regard to the twisting apart of Marxism Marxist Communism by other powers. LJSpeech-1.1/mels/LJ018-0027.pt|In little more than a week a cabman came forward and voluntarily made a statement which at once drew suspicion to a German, Franz Müller, LJSpeech-1.1/mels/LJ001-0169.pt|The paper used for printing the small highly ornamented French service-books about the beginning of the sixteenth century is a model in this respect, LJSpeech-1.1/mels/LJ016-0202.pt|Calcraft's emoluments were a guinea per week, and an extra guinea for every execution. LJSpeech-1.1/mels/LJ047-0186.pt|I can now afford to wait until New Orleans forwarded the necessary papers to me to show me I now had all the information. LJSpeech-1.1/mels/LJ026-0070.pt|Of the substances the solids (salts, etc.) must be dissolved in water before they can be taken in. LJSpeech-1.1/mels/LJ008-0140.pt|Whenever the public attention had been specially called to a particular crime, either on account of its atrocity, LJSpeech-1.1/mels/LJ038-0115.pt|At the first interrogation, Oswald claimed that his only crime was carrying a gun and resisting arrest. LJSpeech-1.1/mels/LJ028-0511.pt|Should you walk along the shore of the Euphrates at Babylon, you would still see the embankments which Nebuchadnezzar constructed of bricks bearing his name, LJSpeech-1.1/mels/LJ011-0228.pt|Mr. W. Wakefield served in a continental army, and rose to the rank of colonel, LJSpeech-1.1/mels/LJ028-0005.pt|Leaving the city by the eastern gate, and passing a small village or two, LJSpeech-1.1/mels/LJ025-0007.pt|so much so as to require discussion in different treatises. LJSpeech-1.1/mels/LJ001-0033.pt|but which must certainly have come from the study of the twelfth or even the eleventh century MSS. LJSpeech-1.1/mels/LJ026-0166.pt|back to starch usable as food and the comparison of the green plant and the animal would be complete. LJSpeech-1.1/mels/LJ007-0113.pt|were revived for the convenience of these gentlemen, whose incarceration was thus rendered as little like imprisonment as possible. LJSpeech-1.1/mels/LJ006-0284.pt|It was a special evil of this part of the prison, that the devotional exercises, originally so profitable, had grown into a kind of edifying spectacle, LJSpeech-1.1/mels/LJ018-0329.pt|their crimes follow in the lines of others already found, and often more than once, in the calendars. LJSpeech-1.1/mels/LJ039-0187.pt|In fact, one of the firers in the rapid fire test in firing his two series of three shots, LJSpeech-1.1/mels/LJ050-0170.pt|This matter is obviously beyond the jurisdiction of the Commission, LJSpeech-1.1/mels/LJ003-0081.pt|Persons convicted of publishing libels were still immured in the same rooms with transports and felons. LJSpeech-1.1/mels/LJ046-0082.pt|must depend upon the utmost cooperation and understanding from the public and the President. LJSpeech-1.1/mels/LJ010-0174.pt|About six p.m. the royal carriage, a low open vehicle drawn by four horses, ridden by postilions, left the palace. LJSpeech-1.1/mels/LJ014-0041.pt|Such an extravagant defense did not weigh with judge or jury; LJSpeech-1.1/mels/LJ050-0266.pt|The exchange of letters dated August thirty-one, nineteen sixty-four, LJSpeech-1.1/mels/LJ045-0187.pt|There is, of course, no way to determine the degree to which he was committed to his plan at that time. LJSpeech-1.1/mels/LJ014-0106.pt|The lime had done its work so rapidly that the features would have been indistinguishable but for the prominent chin and a set of false teeth. LJSpeech-1.1/mels/LJ038-0117.pt|He falsely alleged that he bought the revolver in Fort Worth, when in fact he purchased it from a mail-order house in Los Angeles. LJSpeech-1.1/mels/LJ034-0127.pt|Brennan testified that they were standing, which is their apparent position in the photograph. LJSpeech-1.1/mels/LJ030-0163.pt|Mrs. John F. Kennedy, on the left of the rear seat of the limousine, looked toward her left and waved to the crowds along the route. LJSpeech-1.1/mels/LJ005-0245.pt|This committee animadverted strongly upon the system in force at the metropolitan jails, and more especially upon the condition of Newgate LJSpeech-1.1/mels/LJ038-0202.pt|Prior to the Walker shooting on April ten, Oswald had been attending typing classes on Monday, Tuesday, and Thursday evenings. LJSpeech-1.1/mels/LJ015-0302.pt|who was at length taken in a coffee-shop near Oxford Street, under the name of Hopkins. He resisted at first, and denied his identity, LJSpeech-1.1/mels/LJ036-0013.pt|found along the path of flight taken by the gunman from the scene of the shooting to the place of arrest. LJSpeech-1.1/mels/LJ026-0004.pt|Yet there are many unicellular forms in which both kinds of nutrition go on at the same time; LJSpeech-1.1/mels/LJ014-0282.pt|There were two counts in the indictment: one for stealing a cheque value fourteen hundred pounds, the second for stealing a bit of paper value one penny. LJSpeech-1.1/mels/LJ016-0160.pt|The noose was one of his hammock straps, which he buckled round his throat. LJSpeech-1.1/mels/LJ007-0164.pt|forbid the faintest shadow of a hope that in a soil so unfavorable for moral culture LJSpeech-1.1/mels/LJ041-0119.pt|stating that he would, quote, employ all means to right this gross mistake or injustice, end quote. LJSpeech-1.1/mels/LJ044-0090.pt|I think that we finished him on that program because we had publicly linked the Fair Play for Cuba Committee LJSpeech-1.1/mels/LJ007-0191.pt|has been productive of at least some advantage, LJSpeech-1.1/mels/LJ010-0270.pt|exactly tallied with that of the deformed person "wanted" for the assault on the Queen. LJSpeech-1.1/mels/LJ037-0029.pt|It was Benavides, using Tippit's car radio, who first reported the killing of Patrolman Tippit at about one:sixteen p.m.: LJSpeech-1.1/mels/LJ009-0101.pt|move with a quick, jerking motion, not naturally, but, as it were, like the affected parts of a galvanized corpse. LJSpeech-1.1/mels/LJ016-0162.pt|he fastened one end of the strap above mentioned to the hook, and then fell down. LJSpeech-1.1/mels/LJ032-0169.pt|Having considered the probabilities as explained in Stombaugh's testimony, LJSpeech-1.1/mels/LJ031-0200.pt|The President then walked to the Executive Office Building, where he worked until nine p.m. LJSpeech-1.1/mels/LJ044-0132.pt|He had not liked his job as a greaser of coffee processing machinery and he held it for only a little over two months. LJSpeech-1.1/mels/LJ042-0179.pt|without defense or foundation of government, end quote, LJSpeech-1.1/mels/LJ018-0251.pt|He confessed himself a perjurer in having sworn to the false will, and a wholesale forger, having manufactured no less than ten false signatures LJSpeech-1.1/mels/LJ044-0171.pt|On September twenty, nineteen sixty-three, Mrs. Paine and her two children arrived in New Orleans from a trip to the East Coast LJSpeech-1.1/mels/LJ018-0001.pt|The Chronicles of Newgate, Volume two. By Arthur Griffiths. Section twenty-one: Newgate Notorieties, part two. LJSpeech-1.1/mels/LJ031-0013.pt|Traveling at speeds estimated at times to be up to seventy or eighty miles per hour down the Stemmons Freeway and Harry Hines Boulevard LJSpeech-1.1/mels/LJ006-0188.pt|The days were passed in idleness, debauchery, riotous quarreling, immoral conversation, LJSpeech-1.1/mels/LJ032-0105.pt|quote, I knew there was no such organization. And I know Hidell is merely an altered Fidel, and I laughed at such foolishness. LJSpeech-1.1/mels/LJ010-0259.pt|a deformed lad among the crowd was seen to present a pistol at Her Majesty's carriage, LJSpeech-1.1/mels/LJ014-0084.pt|Returning to her own home, where Manning meantime had been calmly smoking and talking to the neighbors over the basement wall, LJSpeech-1.1/mels/LJ037-0102.pt|He stated further that from, quote, What I saw of him, end quote, the man looked like the man in the picture. LJSpeech-1.1/mels/LJ001-0184.pt|all books might be at least comely and well-looking: and if to these good qualities were added really beautiful ornament and pictures, LJSpeech-1.1/mels/LJ012-0096.pt|At her death the diamonds were divided between her four daughters, but only half had been claimed, LJSpeech-1.1/mels/LJ001-0059.pt|the greater part of these Italian printers, it should be mentioned, were Germans or Frenchmen, working under the influence of Italian opinion and aims. LJSpeech-1.1/mels/LJ026-0083.pt|Starch, however, contains potential energy, since the molecule is relatively unstable LJSpeech-1.1/mels/LJ002-0321.pt|others who arrived just after the time of distribution were often forty-eight hours without food. The latter might also be six days without meat. LJSpeech-1.1/mels/LJ035-0073.pt|was one minute and thirty seconds. LJSpeech-1.1/mels/LJ028-0166.pt|The center of each division of the town is occupied by a fortress. LJSpeech-1.1/mels/LJ028-0209.pt|On the sixteenth day the troops of Cyrus entered Babylon without a battle. LJSpeech-1.1/mels/LJ011-0132.pt|except the forgery of wills and powers of attorney. LJSpeech-1.1/mels/LJ022-0117.pt|Our attack upon these enemies must be without stint and without discrimination. LJSpeech-1.1/mels/LJ019-0118.pt|and later experience has fully proved the advantage of a judicious system of gratuities for labor; LJSpeech-1.1/mels/LJ034-0089.pt|Oswald had not filled any of the three orders. LJSpeech-1.1/mels/LJ003-0114.pt|was appointed judge, and a towel tied in knots was hung on each side in imitation of a wig. LJSpeech-1.1/mels/LJ011-0130.pt|This was on the last day of eighteen twenty-nine. In the following session Sir Robert Peel brought in a bill to consolidate the acts relating to forgery. LJSpeech-1.1/mels/LJ042-0083.pt|Oswald stated, quote, I am a Marxist, end quote. He also alluded to hardships endured by his mother as a worker, LJSpeech-1.1/mels/LJ044-0068.pt|as a result of which he was, quote, flooded with callers and invitations to debates, etc. as well as people interested in joining the F.P.C.C. LJSpeech-1.1/mels/LJ026-0129.pt|Sooner or later the starch grains are changed into a kind of sugar (glucose), which, unlike starch, dissolves in the sap LJSpeech-1.1/mels/LJ014-0309.pt|Few realized that these mysterious operations were the "convulsive attempt" of a ruined and dishonest speculator to sustain his credit. LJSpeech-1.1/mels/LJ032-0224.pt|One of the photographs taken by Marina Oswald was widely published in newspapers and magazines, LJSpeech-1.1/mels/LJ026-0126.pt|as a preliminary to the real processes of nutrition. LJSpeech-1.1/mels/LJ035-0140.pt|On entering, Lovelady saw a girl on the first floor who he believes was Victoria Adams. LJSpeech-1.1/mels/LJ038-0054.pt|He added that one officer grabbed the muzzle of a shotgun, drew back, and hit Oswald with the butt end of the gun in the back. LJSpeech-1.1/mels/LJ012-0117.pt|By-and-by the occupant of the room noticed something glittering in the center of the fire, which, to inspect more closely, he took out with the tongs. LJSpeech-1.1/mels/LJ006-0308.pt|The governor sent down wine on festive occasions, of which no doubt the prisoner housemaid had her share. LJSpeech-1.1/mels/LJ037-0021.pt|Scoggins stated that he thought he had seen a picture of Oswald in the newspapers prior to the lineup identification on Saturday. LJSpeech-1.1/mels/LJ031-0194.pt|At five:fifty-eight p.m. Eastern Standard Time, LJSpeech-1.1/mels/LJ016-0154.pt|When a bit of rope carefully secreted, LJSpeech-1.1/mels/LJ003-0151.pt|All who could scrape together the cash seem to have gladly availed themselves of the privilege of entering the master's side. LJSpeech-1.1/mels/LJ038-0175.pt|Until December three, nineteen sixty-three, the Walker shooting remained unsolved. LJSpeech-1.1/mels/LJ045-0134.pt|Hosty had come to the Paine residence on November one and five, nineteen sixty-three, LJSpeech-1.1/mels/LJ013-0066.pt|By this means her signature was obtained; a forged will was prepared bequeathing the unclaimed stock to Miss Slack; LJSpeech-1.1/mels/LJ013-0185.pt|Three days later a close search of the butler's pantry produced fresh circumstantial evidence. LJSpeech-1.1/mels/LJ047-0109.pt|When Quigley returned to his office, he learned LJSpeech-1.1/mels/LJ021-0204.pt|of regulating only to meet concrete needs -- a practice of courageous recognition of change. LJSpeech-1.1/mels/LJ049-0191.pt|is properly manned and equipped to carry on extensive information gathering functions within the United States. LJSpeech-1.1/mels/LJ003-0135.pt|She went up to the ward and found him lying down, quote, LJSpeech-1.1/mels/LJ023-0106.pt|that something in the Constitution has compelled them regretfully to thwart the will of the people. LJSpeech-1.1/mels/LJ006-0282.pt|the pump was the only provision, and this in a place within sight of visitors, of the windows of the male turnkeys, and unprotected from the weather. LJSpeech-1.1/mels/LJ026-0143.pt|Probably foods containing carbon, hydrogen and oxygen are the sources of energy in the higher plants as in animals. LJSpeech-1.1/mels/LJ011-0178.pt|But another bank had since failed, and nothing could save Mr. Turner but the transfer of some property to Miss Turner, and its settlement on her, LJSpeech-1.1/mels/LJ016-0310.pt|Another distinguished witness feared LJSpeech-1.1/mels/LJ049-0203.pt|So circumscribed, it could not maintain the esprit de corps or the necessary alertness for this unique and challenging responsibility. LJSpeech-1.1/mels/LJ032-0272.pt|(three) fibers found on the rifle most probably came from the shirt Oswald was wearing on the day of the assassination, LJSpeech-1.1/mels/LJ048-0171.pt|it was not practical to select a route where the President could not be seen from roofs or windows of buildings. LJSpeech-1.1/mels/LJ044-0076.pt|Oswald's statements suggest that he hoped to be flooded with callers and invitations to debate. LJSpeech-1.1/mels/LJ032-0147.pt|At the request of the Commission, Arthur Mandella, LJSpeech-1.1/mels/LJ004-0222.pt|Meat was no longer issued raw, to be imperfectly cooked before a ward fire and bolted gluttonously, the whole two pounds at one sitting. LJSpeech-1.1/mels/LJ035-0072.pt|On the first test, the elapsed time between the simulated first shot and Baker's arrival on the second-floor stair landing LJSpeech-1.1/mels/LJ012-0173.pt|The event which he styles calamitous we may well characterize as one of the most deliberately atrocious murders on record. LJSpeech-1.1/mels/LJ007-0087.pt|at Appleby for thirteen years, at Anglesea for fifteen years, at Exeter for sixteen years, and at Pembroke LJSpeech-1.1/mels/LJ040-0238.pt|Such a placement was postponed, however, perhaps in part at least because Lee's behavior suddenly improved. LJSpeech-1.1/mels/LJ019-0220.pt|the uses of Newgate were narrowed almost entirely to those of a prison of detention. LJSpeech-1.1/mels/LJ005-0284.pt|of more depraved and systematic criminals. LJSpeech-1.1/mels/LJ015-0261.pt|The whole strange story, the long incubation and the elaborate accomplishment of the plot, LJSpeech-1.1/mels/LJ013-0113.pt|Robberies as daring in conception as they were boldly executed were common enough. LJSpeech-1.1/mels/LJ028-0383.pt|and the wild beasts of the islands shall cry in their desolate houses, and dragons in their pleasant palaces. LJSpeech-1.1/mels/LJ015-0227.pt|Still watching and waiting for the first chance, they seized it when the clerks left the office empty for a moment. LJSpeech-1.1/mels/LJ036-0106.pt|You could have picked him out without identifying him by just listening to him. LJSpeech-1.1/mels/LJ023-0078.pt|to presume in favor of its validity until its violation of the Constitution is proved beyond all reasonable doubt. LJSpeech-1.1/mels/LJ023-0077.pt|by which any law is passed, LJSpeech-1.1/mels/LJ031-0074.pt|quote, could have easily been hidden in the blood and hair, end quote, LJSpeech-1.1/mels/LJ017-0063.pt|He made no distinct admissions even on the scaffold; but when the chaplain at the last moment exhorted him to confess, LJSpeech-1.1/mels/LJ039-0168.pt|each fired two series of three shots. LJSpeech-1.1/mels/LJ026-0075.pt|are dissolved by the sap in the leaves and elsewhere and thus may pass to every portion of the plant. LJSpeech-1.1/mels/LJ042-0229.pt|To the question of, quote, Are you a Communist? End quote, he first answered "Yes," LJSpeech-1.1/mels/LJ011-0125.pt|The other and the last criminal executed for forgery in this country was one Maynard, who was convicted of a fraud upon the Custom House. LJSpeech-1.1/mels/LJ028-0024.pt|gazing down upon the great Euphrates winding along the valley beneath. LJSpeech-1.1/mels/LJ017-0076.pt|His brother was supposed to have been his next victim, upon whose life he had also effected an insurance for another thirteen thousand pounds. LJSpeech-1.1/mels/LJ028-0374.pt|settled there, and finally the place was abandoned to the Arabs of the desert. LJSpeech-1.1/mels/LJ029-0014.pt|As a political leader, the President wished to resolve the factional controversy within the Democratic Party in Texas before the election of nineteen sixty-four. LJSpeech-1.1/mels/LJ005-0188.pt|that the jails attached to corporate jurisdictions continue to be the fruitful sources LJSpeech-1.1/mels/LJ010-0045.pt|became the victim of the most cowardly and unmanly outrages, and the attempted murder of the sovereign by Oxford in eighteen forty LJSpeech-1.1/mels/LJ033-0088.pt|Frazier met Oswald at the kitchen door and together they walked to the car. LJSpeech-1.1/mels/LJ045-0034.pt|Marina Oswald attributed that to their living apart and to the imminent birth of their second child. LJSpeech-1.1/mels/LJ018-0315.pt|to whom it was said one hundred pounds apiece had been given down as the price of their infidelity. LJSpeech-1.1/mels/LJ046-0127.pt|or from the occasional investigations initiated by the Secret Service, LJSpeech-1.1/mels/LJ038-0211.pt|he said that he, quote, was very sorry that he had not hit him, end quote. Marina Oswald's testimony was fully supported by the note itself LJSpeech-1.1/mels/LJ037-0154.pt|independently examined the four cartridge cases and arrived at the same conclusion as Cunningham. LJSpeech-1.1/mels/LJ024-0116.pt|When the time comes for action, LJSpeech-1.1/mels/LJ008-0230.pt|fell with a strange unnatural sound upon the ear LJSpeech-1.1/mels/LJ038-0089.pt|Expert testimony before the Commission LJSpeech-1.1/mels/LJ008-0273.pt|At the Old Bailey almost every one capitally convicted by a jury was sentenced to be hanged. LJSpeech-1.1/mels/LJ028-0036.pt|But in those very early days Babylon was little more than a shrine, surrounded with mud huts and date palms. LJSpeech-1.1/mels/LJ005-0235.pt|Last, and worst of all, the arrangements for keeping the condemned prisoners between sentence and execution were more than unsatisfactory. LJSpeech-1.1/mels/LJ046-0202.pt|The head of PRS testified that the Secret Service requested other agencies to provide, quote, LJSpeech-1.1/mels/LJ047-0147.pt|The Department of State did not advise either the CIA or the FBI of these facts. LJSpeech-1.1/mels/LJ018-0088.pt|I propose next to describe the leading features of the most important of these. LJSpeech-1.1/mels/LJ027-0011.pt|It is, moreover, true that all living forms are but series of modifications and extensions of one single plan of structure. LJSpeech-1.1/mels/LJ036-0059.pt|The Marsalis bus which Oswald boarded traveled a route west on Elm, LJSpeech-1.1/mels/LJ006-0131.pt|and, if he chose, pass in, all provisions, money, clothes, and letters brought for prisoners by their friends. LJSpeech-1.1/mels/LJ019-0111.pt|healthful, easily learnt, and well adapted to the circumstances of unskilled laborers. LJSpeech-1.1/mels/LJ015-0222.pt|in such a way that Tester had possession of this key for a time. LJSpeech-1.1/mels/LJ024-0007.pt|with the approval, as required by the Constitution, of the Senate of the United States. LJSpeech-1.1/mels/LJ013-0228.pt|In the pocket of the coat Mr. Cope, the governor, found a neatly-folded cloth, and asked what it was for. LJSpeech-1.1/mels/LJ002-0300.pt|Numerous tyrannies were practiced on all who would not and could not pay the garnish. LJSpeech-1.1/mels/LJ029-0151.pt|No arrangements were made for police or building custodians LJSpeech-1.1/mels/LJ016-0296.pt|The actual execution made some impression. LJSpeech-1.1/mels/LJ033-0158.pt|The palmprint was found on the closed end of the bag. LJSpeech-1.1/mels/LJ041-0030.pt|One of his fellow employees, Palmer McBride, stated that Oswald said he would like to kill President Eisenhower because he was exploiting the working class. LJSpeech-1.1/mels/LJ020-0075.pt|Into a second hollow pour the yeast and knead thoroughly for fifteen minutes. LJSpeech-1.1/mels/LJ017-0216.pt|there were also a Frenchman, a Norwegian (the carpenter), three Chinamen, a "Sclavonian," and a black on board. LJSpeech-1.1/mels/LJ044-0174.pt|and possibly to Philadelphia to look for work. LJSpeech-1.1/mels/LJ050-0252.pt|The occasional use of personnel from other Federal agencies to assist in protecting the President has a further advantage. It symbolizes the reality LJSpeech-1.1/mels/LJ013-0242.pt|This increased when the officer, accompanied by two others, a neighbor and a bailiff, entered one of the stables. LJSpeech-1.1/mels/LJ031-0103.pt|While Dr. Carrico went on to attend the President, Dr. Dulany stayed with the Governor and was soon joined by several other doctors. LJSpeech-1.1/mels/LJ029-0154.pt|and Secret Service agents riding in the motorcade. LJSpeech-1.1/mels/LJ006-0053.pt|and the whole by proper management might have been so accommodated as to prevent overcrowding. LJSpeech-1.1/mels/LJ011-0034.pt|These arguments availed little with the jury, who after a short deliberation found Fauntleroy guilty, and he was sentenced to death. LJSpeech-1.1/mels/LJ028-0300.pt|as it is, I kept my own counsel, and so accomplished my plans. LJSpeech-1.1/mels/LJ019-0379.pt|matters went on after the eighteen sixty-five Act much the same as they had done before. Districts differed greatly in the attention they paid to prison affairs. LJSpeech-1.1/mels/LJ004-0180.pt|a price which in those days fluctuated enormously -- as much as a hundred percent in a couple of years; LJSpeech-1.1/mels/LJ008-0256.pt|and with blanched cheek, and sinking, we turned away from the scene. LJSpeech-1.1/mels/LJ050-0115.pt|This is especially necessary with regard to the FBI and CIA, LJSpeech-1.1/mels/LJ009-0200.pt|were publicly exposed in a stable in Little Bridge Street, near Apothecaries' Hall, LJSpeech-1.1/mels/LJ019-0231.pt|and by the following year forty-seven new cells had been built on the most approved plan. LJSpeech-1.1/mels/LJ046-0010.pt|when his temporary residence, Blair House, was attacked by Puerto Rican Nationalists. LJSpeech-1.1/mels/LJ018-0157.pt|In the course of his remarks, however, he said, LJSpeech-1.1/mels/LJ028-0208.pt|Nabonidus fled. LJSpeech-1.1/mels/LJ020-0046.pt|Close the dough over it, dust your hands and kneading-board with flour and work in the shortening until the dough is elastic and ceases to be sticky. LJSpeech-1.1/mels/LJ044-0026.pt|Marina Oswald said she signed that name, apparently chosen because it rhymed with "Fidel," LJSpeech-1.1/mels/LJ013-0002.pt|As the century advanced crimes of fraud increased. LJSpeech-1.1/mels/LJ043-0150.pt|She indicated that she had no advance knowledge of Oswald's plans, LJSpeech-1.1/mels/LJ025-0156.pt|with atmospheric air containing its ordinary minute dose of carbonic acid and with nothing else but sunlight and heat. LJSpeech-1.1/mels/LJ018-0286.pt|and Austin Bidwell opened a bona fide credit in the Burlington or West End branch of the Bank of England, LJSpeech-1.1/mels/LJ040-0180.pt|The Human Figure Drawings are empty, poor characterizations of persons approximately the same age as the subject. LJSpeech-1.1/mels/LJ047-0001.pt|Report of the President's Commission on the Assassination of President Kennedy. The Warren Commission Report. By The President's Commission on the Assassination of President Kennedy. LJSpeech-1.1/mels/LJ038-0072.pt|who had driven from the theatre with Oswald. LJSpeech-1.1/mels/LJ029-0012.pt|He had made only a few brief visits to the State since the nineteen sixty Presidential campaign and in nineteen sixty-two he began to consider a formal visit. LJSpeech-1.1/mels/LJ012-0259.pt|who had been missing since the previous Christmas Day. LJSpeech-1.1/mels/LJ034-0084.pt|became apparent on December two, nineteen sixty-three, when an employee, Frankie Kaiser, LJSpeech-1.1/mels/LJ048-0184.pt|Levels of risk can be determined, however, as has been confirmed by building surveys made since the assassination for the Department of the Treasury. LJSpeech-1.1/mels/LJ027-0087.pt|to be entirely different machines, made each for its own purposes, at once, out of hand. LJSpeech-1.1/mels/LJ026-0100.pt|In the plant the inorganic matter in water from the soil are absorbed by the roots and carried up definite tubes in the woody part of the stem. LJSpeech-1.1/mels/LJ008-0032.pt|a scaffold was erected in front of that prison for the execution of several convicts named by the Recorder. LJSpeech-1.1/mels/LJ002-0124.pt|Quite half of the foregoing writs and arrests applied to sums under thirty pounds. LJSpeech-1.1/mels/LJ019-0159.pt|were constructed on the landings, ensconced in which warders spent the night, on duty, and alert to watch the sleepers below, LJSpeech-1.1/mels/LJ034-0108.pt|man in his early thirties, fair complexion, slender, but neat, neat slender, possible five foot ten LJSpeech-1.1/mels/LJ017-0179.pt|In all cases the symptoms were much the same, LJSpeech-1.1/mels/LJ028-0428.pt|has been removed, and the surrounding city walls have been traced. LJSpeech-1.1/mels/LJ048-0070.pt|reflect keen awareness of the necessity of communicating a much wider range of intelligence information to the Service. LJSpeech-1.1/mels/LJ035-0094.pt|the Commission concluded that Oswald could have fired the shots and still have been present in the second-floor lunchroom when seen by Baker and Truly. LJSpeech-1.1/mels/LJ013-0248.pt|At the same time an overpowering odor attracted them to the adjoining harness-room, where the missing remains were raked out LJSpeech-1.1/mels/LJ008-0269.pt|Already the severity of our criminal code, and the number of capital felonies upon the statute book, had brought a reaction; LJSpeech-1.1/mels/LJ027-0117.pt|"Now, here again the former theory appears to be triumphant over the latter," says Romanes, LJSpeech-1.1/mels/LJ024-0043.pt|that I will appoint justices who will not undertake to override the judgment of the Congress on legislative policy, LJSpeech-1.1/mels/LJ020-0059.pt|When the time is up and the rolls are puffy and promising, set them in a pretty quick oven and bake half an hour, LJSpeech-1.1/mels/LJ048-0049.pt|possessed of this information to list Oswald as a potential threat to the safety of the President. LJSpeech-1.1/mels/LJ048-0177.pt|that such a procedure would not be consistent with the nature and purpose of the motorcade to let the people see their President and to welcome him to their city. LJSpeech-1.1/mels/LJ007-0056.pt|leaden hearts, and "grinding the impressions off penny-pieces, then pricking figures or words on them to give to their friends as memorials. LJSpeech-1.1/mels/LJ032-0059.pt|Experts on handwriting identification from the Treasury Department and the FBI LJSpeech-1.1/mels/LJ015-0097.pt|and he could not produce them. His chief asked sternly where they were. LJSpeech-1.1/mels/LJ036-0130.pt|Whaley described the ensuing events as follows, quote, LJSpeech-1.1/mels/LJ012-0060.pt|to let the coach change and pass Petticoat Lane en route to the jail, where the suffering woman might be handed over to her friends. LJSpeech-1.1/mels/LJ027-0033.pt|On the other hand, external structures are likely to undergo adaptation when habits or conditions of life change. LJSpeech-1.1/mels/LJ047-0141.pt|in early October of nineteen sixty-three. LJSpeech-1.1/mels/LJ047-0219.pt|Quote, Mr. Shanklin advised us, among other things, LJSpeech-1.1/mels/LJ024-0004.pt|It is simply this: whenever a judge or justice of any federal court LJSpeech-1.1/mels/LJ003-0103.pt|It was that of a person, quote, who practiced in the law, and who was connected by marriage with some very respectable families. LJSpeech-1.1/mels/LJ016-0256.pt|It was thought that capital punishment would lose its deterrent effect if it ceased to be public, LJSpeech-1.1/mels/LJ047-0164.pt|At this point in the interview, Hosty gave Mrs. Paine his name and office telephone number on a piece of paper. LJSpeech-1.1/mels/LJ033-0179.pt|since the original bag had been discolored during various laboratory examinations and could not be used for valid identification by witnesses. LJSpeech-1.1/mels/LJ019-0071.pt|moreover, it was nearly impossible to prevent communication and mutual contamination. LJSpeech-1.1/mels/LJ041-0125.pt|Mrs. Oswald said that her husband did not say anything about Governor Connally after his return to the United States. She testified, quote, LJSpeech-1.1/mels/LJ001-0141.pt|The general solidity of a page is much to be sought for LJSpeech-1.1/mels/LJ004-0242.pt|Some attempt was made to reduce the overcrowding, on the recommendation of the House of Commons Committee of eighteen eighteen, but this applied only a partial remedy. LJSpeech-1.1/mels/LJ022-0114.pt|Our responsibility is to all of the people in this country. LJSpeech-1.1/mels/LJ048-0152.pt|At some overpasses all persons were excluded LJSpeech-1.1/mels/LJ044-0173.pt|While Marina Oswald knew of her husband's plan to go to Mexico and thence to Cuba if possible, Mrs. Paine was told that Oswald was going to Houston LJSpeech-1.1/mels/LJ018-0342.pt|It was to effect the rupture of an irksome tie that led Henry Wainwright to murder Harriet Lane deliberately and in cold blood. LJSpeech-1.1/mels/LJ004-0101.pt|Warm and cold baths, or "commodious bathing tubs," LJSpeech-1.1/mels/LJ031-0090.pt|A thorough inspection would have involved washing and cleansing the back, and this is not practical in treating an acutely injured patient. LJSpeech-1.1/mels/LJ047-0018.pt|for the purpose of correlating information inasmuch as he was considered a possible security risk in the event he returned to this country, end quote. LJSpeech-1.1/mels/LJ010-0070.pt|followed the profession of arms, first in the British service, and then in that of the French revolutionary Government. LJSpeech-1.1/mels/LJ008-0090.pt|It was still the custom to offer warm encouragement or bitter disapproval, according to the character and antecedents of the sufferer. LJSpeech-1.1/mels/LJ025-0153.pt|and inquire whether certain differences of a more occult character than those imagined to exist by Cuvier, LJSpeech-1.1/mels/LJ048-0036.pt|that agents of the FBI in Dallas did not consider Oswald's presence in the Texas School Book Depository Building LJSpeech-1.1/mels/LJ008-0145.pt|They were accused by a confederate, who, goaded by conscience, had turned approver, of the murder of a Mr. Steele, LJSpeech-1.1/mels/LJ048-0150.pt|while the Secret Service representatives in Dallas LJSpeech-1.1/mels/LJ021-0117.pt|to the great number of small employers in the smaller communities. LJSpeech-1.1/mels/LJ006-0277.pt|But there were evils akin to those on the male side, prominent amongst which was the undue influence accorded to prisoners. LJSpeech-1.1/mels/LJ049-0075.pt|Recommendations. LJSpeech-1.1/mels/LJ010-0209.pt|Louis and Amadeus among the captains; and Hercules, Neptune, and Mars among the lieutenants of the association. LJSpeech-1.1/mels/LJ048-0080.pt|to coordinate activities and to discuss problems of mutual interest. LJSpeech-1.1/mels/LJ036-0160.pt|He also stated he saw a silver identification bracelet on his passenger's left wrist. LJSpeech-1.1/mels/LJ040-0090.pt|Pic did turn over part of his income to his mother, LJSpeech-1.1/mels/LJ015-0277.pt|When he could get nothing but the blank cheque, he set in motion all sorts of schemes for obtaining signatures, such as LJSpeech-1.1/mels/LJ046-0120.pt|the security processing of gifts sent to the President, and technical inspections against covert listening devices. LJSpeech-1.1/mels/LJ006-0029.pt|The second inspector, the Rev. Whitworth Russell, was the chaplain of Millbank penitentiary, LJSpeech-1.1/mels/LJ049-0153.pt|The Secret Service was organized as a division of the Department of the Treasury in eighteen sixty-five, to deal with counterfeiting. LJSpeech-1.1/mels/LJ041-0019.pt|Voebel said that Oswald, quote, wouldn't start any fights, but if you wanted to start one with him, he was going to make sure that he ended it, LJSpeech-1.1/mels/LJ018-0115.pt|It was stated in evidence that the monies obtained by these forgeries amounted to eight thousand pounds or ten thousand pounds, LJSpeech-1.1/mels/LJ049-0079.pt|Many changes have already been made and others are contemplated, some of them in response to the Commission's questions and informal suggestions. LJSpeech-1.1/mels/LJ036-0096.pt|because of the overwhelming evidence that Oswald was far away from the building by that time. LJSpeech-1.1/mels/LJ009-0103.pt|The silence is short. As the ordinary proceeds 'to conclude,' LJSpeech-1.1/mels/LJ018-0106.pt|He was a German named Kerp, LJSpeech-1.1/mels/LJ039-0116.pt|he had just completed a very intensive preliminary training period. LJSpeech-1.1/mels/LJ045-0113.pt|he did not want his landlady to know his real name because she might read in the paper of the fact that he had been in Russia and that he had been questioned, end quote. LJSpeech-1.1/mels/LJ014-0196.pt|by his identification by Cope in Westminster Hospital, who survived long enough to make a formal deposition before Mr. Jardine, LJSpeech-1.1/mels/LJ046-0124.pt|or with undue persistence. LJSpeech-1.1/mels/LJ012-0292.pt|Mrs. Brown fell with it, and Greenacre, to his horror, found that she was dead. LJSpeech-1.1/mels/LJ002-0282.pt|Those who could not pay were thrown into the wards with the night charges, LJSpeech-1.1/mels/LJ016-0104.pt|whence they let themselves down into the street by the rope. LJSpeech-1.1/mels/LJ040-0149.pt|intense anxiety, shyness, feelings of awkwardness and insecurity, end quote. LJSpeech-1.1/mels/LJ049-0002.pt|The Warren Commission Report. By The President's Commission on the Assassination of President Kennedy. LJSpeech-1.1/mels/LJ014-0242.pt|Employed as a clerk in the Globe Assurance, LJSpeech-1.1/mels/LJ045-0164.pt|He said that he was tired of living alone and perhaps the reason for my being so angry was the fact that we were not living together. LJSpeech-1.1/mels/LJ042-0155.pt|it appears to be the work of a fairly well organized person. LJSpeech-1.1/mels/LJ012-0011.pt|which Mrs. Canning had lost by remarriage. LJSpeech-1.1/mels/LJ011-0120.pt|Unfortunately he took to drink, lost his appointment, and fell from bad to worse. LJSpeech-1.1/mels/LJ006-0074.pt|He was unable to give any reason whatever for not utilizing the whole of the wards. LJSpeech-1.1/mels/LJ030-0231.pt|Most of the other Secret Service agents in the motorcade had drawn their sidearms. LJSpeech-1.1/mels/LJ017-0107.pt|After Cook's death his stepfather, who was much attached to him, came to Rugeley. LJSpeech-1.1/mels/LJ004-0219.pt|The diet was now ample. It consisted of a pound and a half of bread per diem; LJSpeech-1.1/mels/LJ021-0075.pt|But it is an undeniable fact that the restoration of other billions of sound investments to a reasonable earning power LJSpeech-1.1/mels/LJ030-0184.pt|Kellerman grabbed his microphone and radioed ahead to the lead car, LJSpeech-1.1/mels/LJ011-0102.pt|He had gone on board in his Quaker dress, but when captured was found in a light-green frock, LJSpeech-1.1/mels/LJ047-0153.pt|Having determined that Mrs. Paine was a responsible and reliable citizen, Hosty interviewed her on November one. LJSpeech-1.1/mels/LJ039-0241.pt|owned and possessed the rifle used to kill President Kennedy and wound Governor Connally, LJSpeech-1.1/mels/LJ039-0232.pt|the assassin was then required to hit the target one more time within a space of from four point eight to five point six seconds. LJSpeech-1.1/mels/LJ050-0149.pt|PRS must develop the capacity to classify its subjects on a more sophisticated basis than the present geographic breakdown. LJSpeech-1.1/mels/LJ025-0062.pt|under particular circumstances, the contents of the cells of certain water-weeds were set free and moved about with considerable velocity LJSpeech-1.1/mels/LJ018-0301.pt|were lodged at once by drafts to "Horton," another alias, in the Continental Bank. LJSpeech-1.1/mels/LJ036-0218.pt|Four bullets hit Tippit and killed him instantly. LJSpeech-1.1/mels/LJ024-0033.pt|and that a baneful precedent will be established. LJSpeech-1.1/mels/LJ040-0061.pt|Various possible motives will be treated in the appropriate context of the discussion outlined above. LJSpeech-1.1/mels/LJ030-0012.pt|In Houston, as elsewhere during the trip, the crowds showed much interest in Mrs. Kennedy. LJSpeech-1.1/mels/LJ048-0257.pt|and that their conduct the night before did not impede their actions on duty LJSpeech-1.1/mels/LJ011-0173.pt|Miss Turner consented to go on, and they traveled night and day towards the north. LJSpeech-1.1/mels/LJ011-0023.pt|A run upon the bank immediately followed, which was only met by a suspension of payment and the closing of its doors. LJSpeech-1.1/mels/LJ017-0235.pt|He was soon summoned on deck, but as he would not move, the mutineers came down and stood in a circle round his berth. LJSpeech-1.1/mels/LJ045-0086.pt|The De Mohrenschildts also testified that, quote, right in front, end quote, of Oswald Marina Oswald complained about Oswald's inadequacy as a husband. LJSpeech-1.1/mels/LJ036-0004.pt|After leaving the Depository Building at approximately twelve:thirty-three p.m., Lee Harvey Oswald proceeded to his roominghouse by bus and taxi. LJSpeech-1.1/mels/LJ036-0020.pt|The transfer was dated "Friday November twenty-two, 'sixty-three" and was punched in two places by the bus driver. LJSpeech-1.1/mels/LJ016-0425.pt|When visited one day in the condemned cell, just as St. Sepulchre's clock was striking, he looked up and said laughingly, "Go along, clock; LJSpeech-1.1/mels/LJ031-0133.pt|Jack Brooks, Homer Thornberry, and Albert Thomas joined Clifton C. Carter and the group of special agents protecting the Vice President. LJSpeech-1.1/mels/LJ009-0144.pt|In fact his looks denoted extreme sorrow and contrition, LJSpeech-1.1/mels/LJ036-0029.pt|where a man beat on the front door of the bus, boarded it and paid his fare. LJSpeech-1.1/mels/LJ011-0234.pt|Bigger "jobs" than ever were planned and attempted, LJSpeech-1.1/mels/LJ027-0145.pt|that such a recapitulation in the life history of an existing animal of developmental changes successively distinctive of sundry allied, LJSpeech-1.1/mels/LJ006-0291.pt|to clean the governor's office in the male prison; LJSpeech-1.1/mels/LJ006-0225.pt|If any man presumed to turn in too early LJSpeech-1.1/mels/LJ026-0037.pt|It will no doubt occur to the reader that, on the theory of evolution, LJSpeech-1.1/mels/LJ012-0195.pt|and of these Bishop and Williams, who were guilty of many peculiar atrocities, ended their murderous careers in front of the debtors' door at Newgate. LJSpeech-1.1/mels/LJ007-0135.pt|The yards were narrow and confined, mainly because the ground plan was radically vicious. These were evils inseparable from the place. LJSpeech-1.1/mels/LJ012-0284.pt|It was not until he left the bus, and walked up by the Regent's Canal, that he conceived the idea of throwing the head into the water. LJSpeech-1.1/mels/LJ025-0112.pt|With a qualification, to be considered presently, the answer to this question is undoubtedly in the affirmative. LJSpeech-1.1/mels/LJ029-0090.pt|were deployed in and around the Trade Mart. LJSpeech-1.1/mels/LJ012-0270.pt|She had realized all her effects, and brought them with her furniture to Greenacre's lodgings. The two when married were to emigrate to Hudson's Bay. LJSpeech-1.1/mels/LJ008-0260.pt|One of the worst evils was the terrible and long-protracted uncertainty as to the result. LJSpeech-1.1/mels/LJ034-0023.pt|The carton on the windowsill and the large carton below the window contained no prints which could be identified as being those of Lee Harvey Oswald. LJSpeech-1.1/mels/LJ007-0094.pt|had actually been returned as sane from the asylum to which they had been sent, and there was always some uncertainty as to who was mad and who not. LJSpeech-1.1/mels/LJ037-0205.pt|The invoice was prepared on March thirteen, nineteen sixty-three; the revolver was actually shipped on March twenty by Railway Express. LJSpeech-1.1/mels/LJ042-0009.pt|While his defection resulted in part from Oswald's commitment to Marxism, LJSpeech-1.1/mels/LJ019-0164.pt|the personal superintendence of night officers, as already described, became possible. LJSpeech-1.1/mels/LJ046-0011.pt|One out of every five Presidents since eighteen sixty-five has been assassinated; LJSpeech-1.1/mels/LJ019-0339.pt|while decency and good order were to be insured by the strict prohibition of gambling and drunkenness. LJSpeech-1.1/mels/LJ043-0144.pt|and the March eleven, nineteen sixty-three, issue of the Militant. LJSpeech-1.1/mels/LJ035-0209.pt|at twelve:thirty p.m LJSpeech-1.1/mels/LJ044-0048.pt|which occurred eight days after Oswald wrote the above letter to V. T. Lee. LJSpeech-1.1/mels/LJ022-0065.pt|The unemployment insurance part of the legislation LJSpeech-1.1/mels/LJ007-0193.pt|The measures of improvement introduced were mainly as follows: LJSpeech-1.1/mels/LJ011-0062.pt|If the law of this country can receive such a sacrifice, my death will render to heaven an innocent man, and to earth a repentant sinner. LJSpeech-1.1/mels/LJ008-0216.pt|until presently the huge stage loomed dark above the crowd which was now ranged round the barriers; LJSpeech-1.1/mels/LJ005-0190.pt|the knowledge and practice of every species of criminality. LJSpeech-1.1/mels/LJ030-0224.pt|heard noises that sounded like firecrackers and ran toward the President's limousine. LJSpeech-1.1/mels/LJ034-0043.pt|The print, therefore, could have been placed on the carton at any time within this period. LJSpeech-1.1/mels/LJ005-0263.pt|and not, as heretofore, to the judges of assize; that, both to check abuses and watch the progress of improvement, LJSpeech-1.1/mels/LJ028-0481.pt|Nabopolassar, the father, my begetter, built Imgur-Bel, the great wall of Babylon, LJSpeech-1.1/mels/LJ041-0144.pt|Oswald would have had other and more favorable opportunities to strike at the Governor than on this occasion when, as a member of the President's party, LJSpeech-1.1/mels/LJ031-0089.pt|considerable time which at this juncture was not available. LJSpeech-1.1/mels/LJ008-0106.pt|He was introduced by the ordinary, Dr. Forde, a name familiar to the reader, who met him at the felons' door LJSpeech-1.1/mels/LJ012-0066.pt|and begged his wife to send him over a consignment of cheap "righteous" watches, or such as had been honestly obtained, and not "on the cross." LJSpeech-1.1/mels/LJ036-0129.pt|The man asked, quote, May I have the cab?, end quote, and got into the front seat. LJSpeech-1.1/mels/LJ030-0025.pt|when Air Force One touched down at Love Field at eleven:forty a.m., Eastern Standard Time. LJSpeech-1.1/mels/LJ011-0207.pt|whom I never saw until I was taken from Liverpool, and never want to see again. LJSpeech-1.1/mels/LJ010-0254.pt|At the Italian Opera in the evening the audience, on the Queen's appearance, greeted her with loud cheers, and called for the national anthem. LJSpeech-1.1/mels/LJ001-0107.pt|To say a few words on the principles of design in typography: LJSpeech-1.1/mels/LJ021-0063.pt|Benefits of the Industrial Recovery Program have come, LJSpeech-1.1/mels/LJ029-0070.pt|is discussed in chapter eight. LJSpeech-1.1/mels/LJ047-0243.pt|According to Revill, Hosty indicated that he was going to tell this to Lieutenant Wells of the homicide and robbery bureau. LJSpeech-1.1/mels/LJ017-0146.pt|He had all the characteristics of the poisoner -- the calm deliberation, LJSpeech-1.1/mels/LJ021-0148.pt|may be determined and any later adjustments shall be made either by agreement or, in case of disagreement, LJSpeech-1.1/mels/LJ040-0131.pt|Marguerite Oswald visited her son at Youth House, where she recalled that she waited in line, quote, LJSpeech-1.1/mels/LJ022-0047.pt|However, for the first time in five years the relief rolls have declined instead of increased during the winter months. LJSpeech-1.1/mels/LJ029-0050.pt|A check of the geographic indexes there revealed no listing for any individual deemed to be a potential danger to the President LJSpeech-1.1/mels/LJ033-0076.pt|On the morning of November twenty-two, nineteen sixty-three, LJSpeech-1.1/mels/LJ047-0233.pt|his lies to Agent Quigley, his recent visit to Mexico City -- indicated that Oswald was capable of violence. LJSpeech-1.1/mels/LJ050-0190.pt|However, the instructions must be communicated to the local police in any event and can be leaked to the press whether or not they are in writing. LJSpeech-1.1/mels/LJ031-0135.pt|Concern that the Vice President might also be a target for assassination prompted the Secret Service agents to urge him to leave the hospital and return to Washington immediately. LJSpeech-1.1/mels/LJ002-0009.pt|On the twenty-seventh April, in the following year, LJSpeech-1.1/mels/LJ015-0265.pt|was the prime mover, LJSpeech-1.1/mels/LJ026-0132.pt|after absorption into the cells the elements of the starch (or glucose) are, by the living protoplasm, in some unknown way LJSpeech-1.1/mels/LJ032-0258.pt|Ruth and Michael Paine both noticed the rolled-up blanket in the garage during the time that Marina Oswald was living in their home. LJSpeech-1.1/mels/LJ048-0005.pt|There was nothing up to the time of the assassination that gave any indication that this man was a dangerous character who might do harm to the President LJSpeech-1.1/mels/LJ006-0234.pt|More cruel injuries were common enough, which did not result from honest hand-to-hand fights. LJSpeech-1.1/mels/LJ019-0252.pt|while its rigid maintenance was in its opinion vital to the efficiency of the jails. LJSpeech-1.1/mels/LJ015-0251.pt|The latter was ere long arrested on a charge of uttering forged cheques, convicted, and sentenced to transportation for life. LJSpeech-1.1/mels/LJ010-0110.pt|Several of the other prisoners took the same line as regards Edwards, LJSpeech-1.1/mels/LJ032-0227.pt|Shaneyfelt testified that the published photographs appeared to be based on a copy of the original which the publications had each retouched differently. LJSpeech-1.1/mels/LJ033-0121.pt|The distance between the point on the seat and the door was twenty-seven inches. LJSpeech-1.1/mels/LJ041-0168.pt|even though Oswald seemed to be lost in his own thoughts. After a brief period of silence Oswald remarked on the stupidity of the parade LJSpeech-1.1/mels/LJ004-0086.pt|of "poor and needy prisoners committed to the common jail for felony and other misdemeanors, who many times perish before their trial; LJSpeech-1.1/mels/LJ022-0148.pt|to enforce minimum wages, to prevent excessive hours, LJSpeech-1.1/mels/LJ034-0137.pt|The two men, Harold Norman and James Jarman, Jr., each confirmed that when they came out of the building, LJSpeech-1.1/mels/LJ007-0221.pt|The reports as the years flow on reiterate the same complaints. LJSpeech-1.1/mels/LJ018-0033.pt|Directly the foregoing facts were established, a couple of detective officers, armed with a warrant to arrest Müller, LJSpeech-1.1/mels/LJ016-0119.pt|Under superior orders all the doors and gates of this block were left open at night, to allow the night watchman to pass freely to all parts. LJSpeech-1.1/mels/LJ019-0104.pt|That gentleman had come to the conclusion that the ordinary and hackneyed methods of treatment were practically inefficacious, LJSpeech-1.1/mels/LJ011-0145.pt|The new Forgery Act with the Lords' amendment passed into law, but the latter proved perfectly harmless, LJSpeech-1.1/mels/LJ003-0069.pt|In this heterogeneous society were also thrown the unfortunate journalists to whom I have already referred, and on whom imprisonment in Newgate LJSpeech-1.1/mels/LJ038-0091.pt|The Commission has, therefore, placed no reliance on the paraffin tests administered by the Dallas police. LJSpeech-1.1/mels/LJ018-0034.pt|and accompanied by Mr. Death the jeweler and the cabman, went down to Liverpool and took the first steamer across the Atlantic. LJSpeech-1.1/mels/LJ013-0167.pt|The discovery of the murdered man immediately followed. The neighborhood was alarmed, the police sent for, and a close inquiry forthwith commenced. LJSpeech-1.1/mels/LJ025-0021.pt|yet none of these movements justify the ascription to plants of perception of will. LJSpeech-1.1/mels/LJ033-0214.pt|(four) carried the rifle into the Depository Building, concealed in the bag; LJSpeech-1.1/mels/LJ017-0159.pt|and a life-interest in five thousand pounds, a fact on which Smethurst's counsel dwelt with much weight, LJSpeech-1.1/mels/LJ042-0063.pt|with few readily available alternatives at hand. He was shocked to find that the Soviet Union did not accept him with open arms. LJSpeech-1.1/mels/LJ028-0159.pt|thence from the corners of the wall there is carried along each bank of the river a fence of burned bricks. LJSpeech-1.1/mels/LJ036-0193.pt|Description of Shooting LJSpeech-1.1/mels/LJ027-0099.pt|Another striking class of the facts of morphology which admit of scientific explanation only along the line of homology LJSpeech-1.1/mels/LJ050-0003.pt|By The President's Commission on the Assassination of President Kennedy. Chapter eight. The Protection of the President. Part five. LJSpeech-1.1/mels/LJ017-0166.pt|but was careful to prime them with his facts and lead them if possible to accept his diagnosis of the case. LJSpeech-1.1/mels/LJ005-0282.pt|"the comparatively innocent are seduced, the unwary are entrapped, LJSpeech-1.1/mels/LJ005-0150.pt|In some county jails, as I have already said, female prisoners were placed upon the tread-wheel; LJSpeech-1.1/mels/LJ016-0032.pt|Williams as a capital convict was lodged in the press-yard or condemned ward. LJSpeech-1.1/mels/LJ028-0221.pt|When I made my gracious entry into Babylon, with exceeding joy I took up my abode in the royal palace. LJSpeech-1.1/mels/LJ050-0134.pt|that an interagency committee has been established to develop more effective criteria. LJSpeech-1.1/mels/LJ010-0078.pt|On his second release, goaded by his fancied wrongs, he began to plot a dark and dreadful revenge, LJSpeech-1.1/mels/LJ011-0223.pt|Neither his address nor his pamphlet availed much, for the bill for the divorce passed both Houses. LJSpeech-1.1/mels/LJ002-0186.pt|The population generally amounted to from five hundred to seven hundred, the accommodation being calculated for two hundred. LJSpeech-1.1/mels/LJ022-0164.pt|It will put the public utility operating industry on a sound basis for the future, LJSpeech-1.1/mels/LJ034-0183.pt|Boxes and cases were stacked behind him. LJSpeech-1.1/mels/LJ013-0079.pt|when Lord Campbell delivered judgment on Barber's petition, to the effect that LJSpeech-1.1/mels/LJ033-0101.pt|so that it was carried straight and parallel to his body. LJSpeech-1.1/mels/LJ038-0289.pt|As shown above, the note and the photographs of Walker's house and of the nearby railroad tracks LJSpeech-1.1/mels/LJ047-0136.pt|they had vacated their apartment, and Marina Oswald had departed with their child in a station wagon with Texas registration. LJSpeech-1.1/mels/LJ033-0097.pt|Frazier parked the car in the company parking lot about two blocks north of the Depository Building. LJSpeech-1.1/mels/LJ045-0250.pt|there emerged a man capable of assassinating President Kennedy. LJSpeech-1.1/mels/LJ016-0353.pt|Almost absolute silence prevailed until the great bell began to toll its deep note, and broke the stillness with its regular and monotonous clangour, LJSpeech-1.1/mels/LJ019-0053.pt|and our modern practice has prudently tried to steer between the two extremes, accepting as the best system a judicious combination of both. LJSpeech-1.1/mels/LJ013-0012.pt|Her owners insured her for a full sum of two thousand pounds, after which the Wallaces insured her privily LJSpeech-1.1/mels/LJ016-0157.pt|One curious instance of a suicide carried out under the most adverse and extraordinary circumstances may be quoted. LJSpeech-1.1/mels/LJ038-0169.pt|he saw two men, in separate cars, drive out of a church parking lot adjacent to Walker's home. A friend of Walker's testified that LJSpeech-1.1/mels/LJ029-0071.pt|An important purpose of the President's visit to Dallas was to speak at a luncheon given by business and civic leaders. LJSpeech-1.1/mels/LJ007-0117.pt|where the upper ward was exclusively appropriated to their use. They also had their meals sent in, and, with the food, wine almost ad libitum. LJSpeech-1.1/mels/LJ033-0092.pt|the main reason he was going over there that Thursday afternoon when he was to bring back some curtain rods, so I didn't think any more about it when he told me that, end quote, LJSpeech-1.1/mels/LJ045-0076.pt|The letter fell into Oswald's hands when it was returned to his post office box LJSpeech-1.1/mels/LJ049-0152.pt|The assignment of the responsibility of protecting the President to an agency of the Department of the Treasury was largely an historical accident. LJSpeech-1.1/mels/LJ013-0029.pt|Even then she might have been saved, but the captain would not suffer the crew to act. Nearly the whole of the cargo was lost as well as the ship. LJSpeech-1.1/mels/LJ030-0189.pt|he realized that something was wrong, and he pressed down on the accelerator as Kellerman said, quote, Get out of here fast, end quote. LJSpeech-1.1/mels/LJ004-0166.pt|At the bottom was a circular space, through which ran a narrow passage, and the sides of which were fitted with barrack bedsteads. LJSpeech-1.1/mels/LJ028-0191.pt|The old enemies of Babylon rejoiced. LJSpeech-1.1/mels/LJ036-0166.pt|is three to four short blocks south of Lamar and Elm. If Oswald left the bus at twelve:forty-four p.m. LJSpeech-1.1/mels/LJ033-0057.pt|and insert it into the paper bag. LJSpeech-1.1/mels/LJ050-0066.pt|The volume of references to the Secret Service has increased substantially since the new instructions went into effect; LJSpeech-1.1/mels/LJ045-0166.pt|He repeated this not once but several times, but I refused. And he said that once again I was preferring my friends to him, and that I didn't need him. LJSpeech-1.1/mels/LJ007-0024.pt|who supped royally on the supplies provided from outside, and kept it up till ten or eleven o'clock. LJSpeech-1.1/mels/LJ036-0142.pt|Whaley was somewhat imprecise as to where he unloaded his passenger. LJSpeech-1.1/mels/LJ008-0044.pt|and at the distance of five feet from the same is fixed a strong railing all round the scaffold to enclose a place for the constables. LJSpeech-1.1/mels/LJ015-0309.pt|and the judge, in passing sentence on him of transportation for life, expressed deep regret that "the ingenuity, skill, and talent, LJSpeech-1.1/mels/LJ050-0272.pt|and the traditions of the office in a democracy such as ours are so deep-seated as to preclude absolute security. LJSpeech-1.1/mels/LJ014-0238.pt|In eighteen fifty occurred the first of a series of gigantic frauds, LJSpeech-1.1/mels/LJ027-0084.pt|Romanes's "Darwin and After Darwin", and Le Conte's "Evolution." LJSpeech-1.1/mels/LJ041-0067.pt|Other marines also testified that Oswald had few friends and kept very much to himself. LJSpeech-1.1/mels/LJ037-0261.pt|that the jacket belonged to Lee Harvey Oswald, and that when he was arrested at approximately one:fifty p.m., he was in shirt sleeves. LJSpeech-1.1/mels/LJ021-0182.pt|And let it be recorded that the British bankers helped. LJSpeech-1.1/mels/LJ004-0197.pt|No idleness was permitted among the inmates. Trades were taught, or prisoners were allowed to follow their own if suitable. LJSpeech-1.1/mels/LJ002-0065.pt|or female convicts ordered for execution. LJSpeech-1.1/mels/LJ050-0274.pt|made certain recommendations which it believes would, if adopted, LJSpeech-1.1/mels/LJ003-0146.pt|without them the keeper declared that he could not pay the salaries of turnkeys and servants, nor keep the prison going at all. LJSpeech-1.1/mels/LJ039-0225.pt|Based on the known facts of the assassination, LJSpeech-1.1/mels/LJ029-0198.pt|They conveyed the pleas of Dallas leaders that citizens not demonstrate or create disturbances during the President's visit. LJSpeech-1.1/mels/LJ016-0408.pt|During the singing of these hymns Wainwright fainted, but whether from real emotion or the desire to make a sensation was never exactly known. LJSpeech-1.1/mels/LJ038-0063.pt|but that once he was subdued, no officer struck him. LJSpeech-1.1/mels/LJ011-0180.pt|Wakefield added that it had been suggested he should marry Miss Turner, but that he had laughed at the idea. LJSpeech-1.1/mels/LJ003-0285.pt|they should gamble with dice or cards, and play at bumble puppy or some other disreputable game of chance. LJSpeech-1.1/mels/LJ045-0184.pt|Then on Thursday morning, November twenty-one, LJSpeech-1.1/mels/LJ008-0213.pt|By this time the workmen might be heard busily erecting the gallows; LJSpeech-1.1/mels/LJ040-0140.pt|Mrs. Evelyn D Siegel, a social worker who interviewed both Lee and his mother while Lee was confined in Youth House, LJSpeech-1.1/mels/LJ028-0153.pt|The bitumen used in the work was brought to Babylon from Is, a small stream which flows into the Euphrates LJSpeech-1.1/mels/LJ038-0168.pt|There were no eyewitnesses, although a fourteen-year-old boy in a neighboring house claimed that immediately after the shooting LJSpeech-1.1/mels/LJ008-0285.pt|on the one hand the gallows, on the other a short imprisonment. LJSpeech-1.1/mels/LJ019-0298.pt|The total want of administration was very marked, LJSpeech-1.1/mels/LJ028-0059.pt|His military career began while he was still the crown prince, and his father was on the throne. LJSpeech-1.1/mels/LJ005-0121.pt|By degrees, however, LJSpeech-1.1/mels/LJ015-0200.pt|only when single and unprotected were they in any danger of attack, and that but rarely. LJSpeech-1.1/mels/LJ014-0295.pt|This man got up to look for him, and found him hanging from the bars of a neighboring room. LJSpeech-1.1/mels/LJ027-0151.pt|The only alternative view is that as species of deer, LJSpeech-1.1/mels/LJ039-0130.pt|After reviewing Oswald's marksmanship scores, LJSpeech-1.1/mels/LJ022-0070.pt|Provisions for social security, however, are protections for the future. LJSpeech-1.1/mels/LJ044-0039.pt|they said something about remodeling, etc. I'm sure you understand, end quote. LJSpeech-1.1/mels/LJ049-0078.pt|have properly taken the initiative in reexamining major aspects of Presidential protection. LJSpeech-1.1/mels/LJ037-0004.pt|At least twelve persons saw the man with the revolver in the vicinity of the Tippit crime scene at or immediately after the shooting. LJSpeech-1.1/mels/LJ001-0145.pt|No definite rules, however, except the avoidance of "rivers" and excess of white, can be given for the spacing, LJSpeech-1.1/mels/LJ039-0230.pt|With the equipment he [Oswald] had and with his ability I consider it a very easy shot, end quote. LJSpeech-1.1/mels/LJ023-0112.pt|We have, therefore, LJSpeech-1.1/mels/LJ026-0092.pt|animals (and colorless plants as well) apparently could not long exist. LJSpeech-1.1/mels/LJ040-0139.pt|while he liked Youth House, he missed the freedom of doing what he wanted. He indicated that he did not miss his mother, end quote. LJSpeech-1.1/mels/LJ030-0191.pt|According to Kellerman, Mrs. Kennedy then cried out, quote, LJSpeech-1.1/mels/LJ028-0084.pt|Its impression shows the face of a beardless young man, intelligent and refined. LJSpeech-1.1/mels/LJ016-0394.pt|The request was not granted, as the old custom of allowing capital convicts whatever they asked for in the way of food has not been the rule in Newgate. LJSpeech-1.1/mels/LJ016-0376.pt|literally walked over what, in case of conviction, would be their own graves. LJSpeech-1.1/mels/LJ001-0062.pt|Even in Italy most of the theological and law books were printed in Gothic letter, LJSpeech-1.1/mels/LJ007-0234.pt|slanting downwards from the top of the walls to the outside adjoining the slaughterhouses of Newgate market; and occasionally, in hot weather, LJSpeech-1.1/mels/LJ028-0414.pt|All the ground on which Babylon was spread is left now desolate; nothing standing in that Peninsula between the Euphrates and the Tigris, LJSpeech-1.1/mels/LJ044-0044.pt|to an attack by Cuban exiles in a street demonstration and being, quote, officialy cautioned, end quote, by the police. LJSpeech-1.1/mels/LJ032-0222.pt|Moreover, Shaneyfelt testified that in his opinion the photographs were not composites of two different photographs LJSpeech-1.1/mels/LJ007-0073.pt|to that line of conduct which his duty imposed on him LJSpeech-1.1/mels/LJ017-0204.pt|who said that he feared it was only too true that secret poisoning was at that time very rife in the metropolis. LJSpeech-1.1/mels/LJ002-0313.pt|It generally ran to about six pounds per week. The money, which at one time had been distributed quarterly, and all went in drink, LJSpeech-1.1/mels/LJ045-0209.pt|but it was also, at least in part, because his wife did not want to live there with him. LJSpeech-1.1/mels/LJ003-0303.pt|The personal cleanliness of all prisoners was to be insisted upon; they should be made to wash at least once a day, LJSpeech-1.1/mels/LJ010-0280.pt|On June eighteen fifty the Queen was once more subjected to cowardly outrage, the offender being a Mr. Pate, a gentleman by birth, LJSpeech-1.1/mels/LJ011-0087.pt|Montgomery was duly sentenced to death, but he preferred suicide to the gallows. After sentence his demeanor was serious yet firm. LJSpeech-1.1/mels/LJ040-0071.pt|From the time Marguerite Oswald returned to work until December twenty-six, nineteen forty-two, when Lee too was sent to the orphans' home, LJSpeech-1.1/mels/LJ037-0104.pt|manager of a used-car lot on the northeast corner of Patton Avenue and Jefferson Boulevard, and Sam Guinyard, a porter at the lot. LJSpeech-1.1/mels/LJ018-0245.pt|in all good faith to another, but a criminal member of the family. LJSpeech-1.1/mels/LJ039-0082.pt|this is the ideal type of weapon for moving targets LJSpeech-1.1/mels/LJ001-0182.pt|the books so ornamented are amongst the most delightful works of art that have ever been produced. LJSpeech-1.1/mels/LJ007-0196.pt|the provision of dining-rooms and dining-tables. LJSpeech-1.1/mels/LJ002-0148.pt|and that no more than one hundred ninety-seven creditors recovered debts and costs. LJSpeech-1.1/mels/LJ013-0197.pt|Mr. Phillips, who led in the case, went to the other extreme, LJSpeech-1.1/mels/LJ040-0134.pt|that anybody entering this home had to be searched in case the parents were bringing cigarettes or narcotics or anything, end quote. LJSpeech-1.1/mels/LJ015-0255.pt|and begged his accomplice to invest it as a settlement on a woman named Kay, by whom he had had a child. LJSpeech-1.1/mels/LJ015-0141.pt|from which he rose to be assistant registrar, with the special duties of transferring shares. LJSpeech-1.1/mels/LJ049-0110.pt|The governmental consequences of assassination of one of the specified officials give the United States ample power to act for its own protection. LJSpeech-1.1/mels/LJ040-0152.pt|turning around the topics of omnipotence and power, through which he tries to compensate for his present shortcomings and frustrations, end quote. LJSpeech-1.1/mels/LJ009-0173.pt|from eighteen thirty-two to eighteen forty-four not a single person had been executed in the metropolis except for this the gravest crime. LJSpeech-1.1/mels/LJ003-0079.pt|Mr. Bennet refers to a gentleman confined for want of bail, who occupied a room with five others LJSpeech-1.1/mels/LJ019-0027.pt|The internal arrangements of the new model were carefully supervised by a body of distinguished men, among which were many peers, Lord John Russell, LJSpeech-1.1/mels/LJ048-0125.pt|the precautions taken for the President's trip were the usual safeguards employed on trips of this kind in the United States during the previous year, end quote. LJSpeech-1.1/mels/LJ022-0073.pt|Our problem is to put to work three and one-half million employable persons now on the relief rolls. LJSpeech-1.1/mels/LJ013-0105.pt|Elder, the former, was soon apprehended at his house, but he evaded the law by hanging himself with his pocket-handkerchief. LJSpeech-1.1/mels/LJ011-0083.pt|For a long time justice did not overtake him for any criminal offense, but he was frequently in Newgate and in the King's Bench for debt. LJSpeech-1.1/mels/LJ002-0041.pt|Two other wards were appropriated to the master's side debtors; they were each twenty-three feet by fourteen and a half, LJSpeech-1.1/mels/LJ046-0213.pt|members of his immediate family, the President-elect, and the Vice-President. Investigation of threats against the President of the United States, LJSpeech-1.1/mels/LJ005-0195.pt|There was no decency whatever in the internal arrangements; LJSpeech-1.1/mels/LJ019-0020.pt|Up to the twenty-first December, eighteen forty-two, LJSpeech-1.1/mels/LJ003-0161.pt|The luxury of the state side was for a long time open to all who could pay LJSpeech-1.1/mels/LJ050-0172.pt|The Commission, therefore, recommends that the President consider ordering an inquiry into the possibility LJSpeech-1.1/mels/LJ050-0089.pt|While these tentative criteria are a step in the right direction, LJSpeech-1.1/mels/LJ046-0098.pt|The history of Presidential protection shows growing recognition over the years that the job must be done by able, dedicated, LJSpeech-1.1/mels/LJ037-0074.pt|and her positive identification of Oswald at a police lineup, the Commission considers her testimony reliable. LJSpeech-1.1/mels/LJ033-0020.pt|prior to November twenty-one, nineteen sixty-three, except on Monday, October twenty-one, when he visited his wife in the hospital LJSpeech-1.1/mels/LJ019-0362.pt|Where the local authority had neglected to comply with the provisions of the eighteen sixty-five Act for four consecutive years, LJSpeech-1.1/mels/LJ019-0036.pt|This list included Wakefield, Leeds, Kirkdale, Manchester, Birmingham, and Dublin. LJSpeech-1.1/mels/LJ005-0212.pt|and the prison allowance was still limited to bread and water. LJSpeech-1.1/mels/LJ048-0206.pt|As the motorcade approached Elm Street LJSpeech-1.1/mels/LJ024-0037.pt|who would disregard the law and would decide specific cases as I wished them to be decided, I make this answer: LJSpeech-1.1/mels/LJ015-0063.pt|But neither Robson nor Redpath would have been able to pursue their fraudulent designs with success had they not, like Watts, LJSpeech-1.1/mels/LJ033-0102.pt|When Oswald entered the rear door of the Depository Building, he was about fifty feet ahead of Frazier. LJSpeech-1.1/mels/LJ022-0151.pt|did more than anything else to bring about the recent collapse of industries. LJSpeech-1.1/mels/LJ003-0054.pt|An imperfect attempt at classification was, however, made in eighteen twelve, and a yard was as far as possible set apart for the untried, LJSpeech-1.1/mels/LJ015-0192.pt|From the moment of his reception he gave himself great airs, as a martyr and a man heavily wronged. LJSpeech-1.1/mels/LJ025-0123.pt|has not only been discovered to exist far more widely among plants than was formerly imagined, LJSpeech-1.1/mels/LJ035-0134.pt|that they were watching the parade from the top step of the building entrance when Gloria Calverly, who works in the Depository Building, LJSpeech-1.1/mels/LJ014-0310.pt|Pries, although enjoying a high reputation in the city, had long been in a bad way. LJSpeech-1.1/mels/LJ030-0179.pt|She watched as he slumped down with an empty expression on his face. LJSpeech-1.1/mels/LJ008-0150.pt|Four years passed without the detection of the murderers, LJSpeech-1.1/mels/LJ039-0174.pt|The marksmen took as much time as they wanted for the first target and all hit the target. LJSpeech-1.1/mels/LJ041-0089.pt|Thornley added, quote, I think it was kind of necessary to him to believe that he was being picked on. LJSpeech-1.1/mels/LJ029-0207.pt|On November twenty-one there appeared on the streets of Dallas the anonymous handbill mentioned above. LJSpeech-1.1/mels/LJ010-0092.pt|Lord Harrowby's dinner-party was postponed, but the conspirators knew nothing of it, LJSpeech-1.1/mels/LJ022-0113.pt|to make a major attack upon the problem of unemployment. LJSpeech-1.1/mels/LJ028-0060.pt|In six oh five, LJSpeech-1.1/mels/LJ019-0044.pt|The south and west of England were also very laggard, and many years were still to elapse before the prisons in these parts were properly reconstituted. LJSpeech-1.1/mels/LJ029-0079.pt|was a one-story building with few entrances and easy to make secure, but it lacked necessary food-handling facilities LJSpeech-1.1/mels/LJ020-0050.pt|Toss the lump dough upon it and knead thoroughly for five minutes. LJSpeech-1.1/mels/LJ002-0176.pt|Neild gives a list of the various items charged upon a debt of ten pounds, which included instructions to sue, LJSpeech-1.1/mels/LJ005-0202.pt|An examination of this report shows how even the most insignificant township had its jail. LJSpeech-1.1/mels/LJ049-0019.pt|The last Presidential vehicle with any protection against small-arms fire left the White House in nineteen fifty-three. LJSpeech-1.1/mels/LJ011-0165.pt|who had plausibly explained that he had only recently been engaged at Shrigley. LJSpeech-1.1/mels/LJ039-0031.pt|Mr. Nixon advised the Commission that the only time he was in Dallas in nineteen sixty-three LJSpeech-1.1/mels/LJ028-0218.pt|Without a skirmish or a battle, he permitted them to enter Babylon, and, sparing the city, he delivered the King Nabonidus to him. LJSpeech-1.1/mels/LJ004-0163.pt|and of which fewer still would believe that the original is to be found in this enlightened and happy country." LJSpeech-1.1/mels/LJ037-0255.pt|testified that Commission Exhibit Number one sixty-two was the jacket worn by the man they saw on November twenty-two. LJSpeech-1.1/mels/LJ044-0106.pt|and Benjamin J. Davis honorary membership cards in his nonexistent New Orleans chapter of the Fair Play for Cuba Committee, LJSpeech-1.1/mels/LJ019-0214.pt|The Corporation owned lands there covering from nineteen to twenty acres. LJSpeech-1.1/mels/LJ030-0213.pt|Hill heard a second shot, proximately five seconds after the first, which removed a portion of the President's head. LJSpeech-1.1/mels/LJ013-0043.pt|This person made much of Wallace, encouraged his attentions to his daughter, LJSpeech-1.1/mels/LJ008-0013.pt|As regards the first, I find that in seventeen eighty-six LJSpeech-1.1/mels/LJ004-0076.pt|"Disease, cold, famine, nakedness, and contagious and polluted air are not lawful punishments in the hands of the civil magistrates; LJSpeech-1.1/mels/LJ040-0133.pt|She said that her pocketbook was searched, quote, because the children in this home were such criminals, dope fiends, and had been in criminal offenses, LJSpeech-1.1/mels/LJ048-0031.pt|While he had expressed hostility at times toward the State Department, the Marine Corps, and the FBI as agents of the Government, LJSpeech-1.1/mels/LJ001-0073.pt|went on apace; and by the end of the sixteenth century there was no really beautiful printing done: LJSpeech-1.1/mels/LJ020-0076.pt|Wrap bowl and biscuit in a thick cloth and set to rise where it will neither become chilled nor sour over night. LJSpeech-1.1/mels/LJ019-0166.pt|those for trial, and those sentenced for short terms or long LJSpeech-1.1/mels/LJ038-0097.pt|the Commission gave little weight to his denials of guilt. LJSpeech-1.1/mels/LJ042-0116.pt|Under the entry for May one, nineteen sixty, LJSpeech-1.1/mels/LJ035-0012.pt|At about this time he heard the first shot. LJSpeech-1.1/mels/LJ019-0102.pt|which was promptly carried, with the additional instruction to the committee to suggest any improvements. LJSpeech-1.1/mels/LJ003-0115.pt|The judge sat in proper form; he was punctiliously styled "my lord." LJSpeech-1.1/mels/LJ002-0154.pt|Thus, amongst others, Thomas Blackburn had been committed on October fifteenth for a debt of one shilling five pence. LJSpeech-1.1/mels/LJ048-0010.pt|stressed also the decision by the Department of State that Oswald should be permitted to return to the United States. LJSpeech-1.1/mels/LJ003-0309.pt|Proper hours for locking and unlocking prisoners should be insisted upon; LJSpeech-1.1/mels/LJ036-0032.pt|So I gave her a transfer and opened the door and she was going out the gentleman I had picked up about two blocks [back] LJSpeech-1.1/mels/LJ001-0177.pt|so that if the two are helpful to one another it is a mere matter of accident. LJSpeech-1.1/mels/LJ033-0069.pt|As she [Marina] told me about it I stepped onto the blanket roll LJSpeech-1.1/mels/LJ035-0172.pt|There he was met by a construction worker -- in all likelihood Howard Brennan, who was wearing his work helmet. LJSpeech-1.1/mels/LJ041-0057.pt|His study of Communist literature, LJSpeech-1.1/mels/LJ044-0208.pt|An examination of the Militant, to which Oswald subscribed, LJSpeech-1.1/mels/LJ036-0207.pt|The suspect was described as a, quote, LJSpeech-1.1/mels/LJ011-0081.pt|He was not prosecuted for this fraud on account of the respectability of his family, and soon after this escape LJSpeech-1.1/mels/LJ028-0229.pt|The Babylonians, encamped without their walls, awaited his coming. LJSpeech-1.1/mels/LJ016-0368.pt|It was they who formed the chief part of the small select group of spectators; LJSpeech-1.1/mels/LJ007-0011.pt|But it was already plain that they constituted an independent authority within the jails; they were frequently in conflict with the chaplain, LJSpeech-1.1/mels/LJ011-0250.pt|While thus engaged, Howard thrust the poker into the fire. LJSpeech-1.1/mels/LJ021-0180.pt|to issue new bonds therefore bearing only three and one half percent interest, LJSpeech-1.1/mels/LJ011-0128.pt|Maynard was convicted of uttering the forged document, Jones of being an accessory; the third prisoner was acquitted. LJSpeech-1.1/mels/LJ028-0469.pt|The inner wall of Babylon was called Imgur-Bel, and like the outer wall, it was double. LJSpeech-1.1/mels/LJ040-0030.pt|When he was in the Soviet Union, he apparently resented the Communist Party members, LJSpeech-1.1/mels/LJ015-0291.pt|partly through their own carelessness, when transferring their operations to Yarmouth. LJSpeech-1.1/mels/LJ045-0222.pt|The feelings of hostility and aggression which seem to have played such an important, part in Oswald's life LJSpeech-1.1/mels/LJ001-0026.pt|On the whole the type of this book may be considered the ne-plus-ultra of Gothic type, LJSpeech-1.1/mels/LJ024-0006.pt|a new member shall be appointed by the President then in office, LJSpeech-1.1/mels/LJ024-0114.pt|and who would be willing to support a reasonable amendment if they could agree on one. LJSpeech-1.1/mels/LJ042-0059.pt|Despite this commitment to the Soviet Union LJSpeech-1.1/mels/LJ013-0119.pt|Howse, the steward, accused the other servants, but they retorted, declaring that he had been visited by the thief the day previous, LJSpeech-1.1/mels/LJ029-0102.pt|After the selection of the Trade Mart as the luncheon site, LJSpeech-1.1/mels/LJ046-0002.pt|The President's Commission on the Assassination of President Kennedy. Chapter eight. The Protection of the President. Part one. LJSpeech-1.1/mels/LJ019-0372.pt|It was practically inoperative as regards the penalties for neglect. It was no doubt as irksome and inconvenient to the Secretary of State LJSpeech-1.1/mels/LJ047-0248.pt|that he ever said that Oswald was capable of violence, or that he had any information suggesting this. LJSpeech-1.1/mels/LJ003-0134.pt|One day he was too ill to come down and meet her. LJSpeech-1.1/mels/LJ005-0094.pt|to call for information as to the observance of its provisions. LJSpeech-1.1/mels/LJ021-0171.pt|Now that these people are coming out of their storm cellars, they forget that there ever was a storm. LJSpeech-1.1/mels/LJ004-0007.pt|It was so powerless against the persistent neglect of those intrusted with prison management, that, five-and-twenty years later, LJSpeech-1.1/mels/LJ016-0361.pt|the moment too that the condemned man had passed through the debtors' door on to the scaffold the prison had done with him, LJSpeech-1.1/mels/LJ019-0357.pt|The Secretary of State was empowered to deal rather summarily with "inadequate" prisons, in other words, LJSpeech-1.1/mels/LJ002-0163.pt|a market porter, was arrested and committed at the suit of a publican LJSpeech-1.1/mels/LJ049-0204.pt|While in accordance with its mandate LJSpeech-1.1/mels/LJ031-0121.pt|Dr. George T. Shires, assisted by Drs. Robert McClelland, Charles Baxter, and Ralph Don Patman, LJSpeech-1.1/mels/LJ019-0198.pt|and on a more mature consideration he realized that the limited area of the existing Newgate site, LJSpeech-1.1/mels/LJ011-0155.pt|He had eloped with his first wife from school. LJSpeech-1.1/mels/LJ015-0293.pt|as coming from a Mr. Whitney. LJSpeech-1.1/mels/LJ036-0206.pt|again at twelve:forty-eight p.m., and again at twelve:fifty-five p.m. LJSpeech-1.1/mels/LJ016-0003.pt|and that none of its inmates could hope to escape from its secure precincts. LJSpeech-1.1/mels/LJ020-0037.pt|The oven must be steady, but not so hot as for white bread, nor will the Graham bread be done quite so soon as that made of bolted flour. LJSpeech-1.1/mels/LJ028-0387.pt|The Sassanian kings of Persia were fond of hunting, and Babylon, then overgrown with trees, was their game preserve. LJSpeech-1.1/mels/LJ017-0168.pt|But a long public discussion followed, and in consequence he was reprieved. LJSpeech-1.1/mels/LJ015-0173.pt|Warrants were issued for Redpath's arrest, but he had flown to Paris. LJSpeech-1.1/mels/LJ006-0033.pt|The ink was barely dry upon their letters of appointment before they appeared at Newgate, and commenced a searching investigation. LJSpeech-1.1/mels/LJ010-0283.pt|and walking for choice through prickly gorse bushes. LJSpeech-1.1/mels/LJ009-0085.pt|'Now for you, my poor fellow mortals, who are about to suffer the last penalty of the law.' LJSpeech-1.1/mels/LJ006-0297.pt|Some member of the Ladies' Association observed and commented upon the fact that a "young rosy-cheeked girl" had been kept by the governor from transportation, LJSpeech-1.1/mels/LJ024-0094.pt|It would take months and years thereafter to get a two-thirds majority in favor of that amendment in both Houses of the Congress. LJSpeech-1.1/mels/LJ002-0092.pt|The two yards were adjoining, that for the common side much the largest. LJSpeech-1.1/mels/LJ008-0186.pt|The concourse was very great, notwithstanding these warnings. LJSpeech-1.1/mels/LJ009-0202.pt|In eighteen eleven Williams, who murdered the Marrs in Ratcliffe Highway, having committed suicide in jail to escape hanging, LJSpeech-1.1/mels/LJ009-0277.pt|For a second or two the body hung motionless, then, with a strength that astonished the attendant officials, LJSpeech-1.1/mels/LJ047-0060.pt|Fain had been assigned to see Marina Oswald at an appropriate time. LJSpeech-1.1/mels/LJ020-0042.pt|and these also tend to nourish and strengthen the brain. LJSpeech-1.1/mels/LJ034-0005.pt|He worked principally on the first and sixth floors of the building, gathering books listed on orders and delivering them to the shipping room on the first floor. LJSpeech-1.1/mels/LJ050-0063.pt|and who have been involved in bombing or bomb-making or whose past conduct indicates tendencies toward violence, and (d) LJSpeech-1.1/mels/LJ045-0081.pt|Although she denied it in some of her testimony before the Commission, LJSpeech-1.1/mels/LJ006-0266.pt|On these occasions precautions were supposed to be taken to exclude bad characters, LJSpeech-1.1/mels/LJ047-0045.pt|and promised to advise the FBI if he heard from them. LJSpeech-1.1/mels/LJ017-0267.pt|After condemnation, as the rules now kept capital convicts strictly apart, they could not be lodged in the two condemned cells, LJSpeech-1.1/mels/LJ008-0243.pt|Threading his way among these itinerant vendors was seen the meek-faced deliverer of tracts, the man of good intentions, now bonneted, LJSpeech-1.1/mels/LJ034-0054.pt|In addition, Mandella was of the opinion that the print taken from the carton on the floor LJSpeech-1.1/mels/LJ013-0216.pt|His account of his acts and movements after the deed LJSpeech-1.1/mels/LJ011-0233.pt|that thieves or depredators were idle or entirely unsuccessful. LJSpeech-1.1/mels/LJ033-0176.pt|taken from the Texas School Book Depository shipping room on November twenty-two, nineteen sixty-three. LJSpeech-1.1/mels/LJ028-0487.pt|Fortunately its walls have suffered less from the hands of the brick hunters, and the German excavators have been able to reconstruct their plan. LJSpeech-1.1/mels/LJ047-0205.pt|to potential danger, quote, LJSpeech-1.1/mels/LJ031-0085.pt|Since the Dallas doctors directed all their efforts to controlling the massive bleeding caused by the head wound, and to reconstructing an airway to his lungs, LJSpeech-1.1/mels/LJ006-0252.pt|The worst fights occurred on Sunday afternoons; but nearly every night the act of locking up became, from the consequent removal of all supervision, LJSpeech-1.1/mels/LJ015-0295.pt|he was told it was only at Mr. Whitney's disposal, and that it could be paid to no one else. LJSpeech-1.1/mels/LJ004-0169.pt|On the dirty bedstead lay a wretched being in the throes of severe illness. LJSpeech-1.1/mels/LJ009-0168.pt|robbery, burglary, and arson. LJSpeech-1.1/mels/LJ009-0148.pt|But the chaplain admitted that the solitude of the convict's cell LJSpeech-1.1/mels/LJ048-0187.pt|In addition, Secret Service agents riding in the motorcade were trained to scan buildings as part of their general observation of the crowd of spectators. LJSpeech-1.1/mels/LJ004-0141.pt|The hospital was filled with infectious cases, and in one room, seven feet by nine, with closed windows, LJSpeech-1.1/mels/LJ032-0153.pt|A palmprint could not be placed on this portion of the rifle, when assembled, because the wooden foregrip covers the barrel at this point. LJSpeech-1.1/mels/LJ019-0243.pt|and thus bring the history of prison discipline down to our own times. LJSpeech-1.1/mels/LJ037-0174.pt|but only two of the four discarded cartridge cases found on the lawn at tenth Street and Patton Avenue were of Winchester-Western manufacture. LJSpeech-1.1/mels/LJ010-0146.pt|Attacks upon the sovereign, as I have said, became more common after the accession of the young Queen Victoria in eighteen thirty-eight. LJSpeech-1.1/mels/LJ014-0019.pt|His name was Hocker; he was by trade a ladies' shoemaker; and it was also ascertained that after the day of the murder he was flush of money. LJSpeech-1.1/mels/LJ008-0105.pt|Mr. Smith's account of the condemned convict, whose cell he was permitted to enter, may be inserted here. LJSpeech-1.1/mels/LJ028-0317.pt|Introduced into their assembly, he began to bewail his misfortunes, telling them that LJSpeech-1.1/mels/LJ033-0186.pt|one cannot estimate when, prior to November twenty-two, Oswald made the paper bag. LJSpeech-1.1/mels/LJ035-0110.pt|Both Dougherty and Piper were confused witnesses. They had no exact memory of the events of that afternoon. LJSpeech-1.1/mels/LJ045-0131.pt|Neither Hosty nor any other agent of the FBI spoke to Oswald on any subject from August ten, nineteen sixty-three, LJSpeech-1.1/mels/LJ012-0156.pt|His arrest and conviction cast dismay over the whole gang of receivers, and for a time seriously checked the nefarious traffic. LJSpeech-1.1/mels/LJ004-0130.pt|incommodious, as has been stated, insecure, unhealthy, and unprovided with the printed or written regulations required by law. LJSpeech-1.1/mels/LJ013-0220.pt|that Courvoisier was idle, discontented, ready to take offense, greedy of gain; LJSpeech-1.1/mels/LJ033-0085.pt|She then opened the kitchen door and saw Oswald open the right rear door of her brother's car and place the package in the back of the car. LJSpeech-1.1/mels/LJ017-0143.pt|which followed close on its heels, although in that the verdict of "Not Guilty" was excusable, as the evidence was entirely circumstantial. LJSpeech-1.1/mels/LJ021-0068.pt|to a level of sustained profits within one year from the inauguration of N.R.A. LJSpeech-1.1/mels/LJ030-0135.pt|Mrs. Connally, elated by the reception, turned to President Kennedy and said, quote, Mr. President, you can't say Dallas doesn't love you. LJSpeech-1.1/mels/LJ015-0045.pt|the firm's paper went down further and further in value; an application to the Committee of Bankers for assistance was peremptorily refused, LJSpeech-1.1/mels/LJ008-0009.pt|But the Old Bailey was not exclusively used; LJSpeech-1.1/mels/LJ004-0019.pt|were as yet but imperfectly understood, and such portions of the "improved" jails of that period as were still extant a few years back, LJSpeech-1.1/mels/LJ002-0303.pt|Besides these fees, legitimate and illegitimate, there were others which must be paid before release. LJSpeech-1.1/mels/LJ014-0178.pt|His offense was the murder of Richard Cope, LJSpeech-1.1/mels/LJ045-0089.pt|Marina Oswald also ridiculed her husband's political views, thereby tearing down his view of his own importance. LJSpeech-1.1/mels/LJ037-0111.pt|Guinyard and Callaway ran to tenth and Patton and found Tippit lying in the street beside his car. LJSpeech-1.1/mels/LJ020-0018.pt|Throw a cloth over the bowl and set by for five or six hours to rise. LJSpeech-1.1/mels/LJ046-0242.pt|Such an approach seriously undermines the precautionary nature of PRS work; LJSpeech-1.1/mels/LJ029-0161.pt|From the airport, the President's party will proceed to Mockingbird Lane to Lemmon and then to Turtle Creek, turning south to Cedar Springs. LJSpeech-1.1/mels/LJ050-0024.pt|toward the preparation of formal understandings of the respective roles of the Secret Service and other agencies with which it collaborates LJSpeech-1.1/mels/LJ013-0218.pt|His last statement contains the words, "The public now think I am a liar, and they will not believe me when I say the truth." LJSpeech-1.1/mels/LJ015-0029.pt|In December eighteen fifty-one the balance sheet showed a deficiency of upwards of seventy thousand pounds. LJSpeech-1.1/mels/LJ008-0236.pt|coiled up on the floor of the scaffold like a serpent, the hangman's rope! LJSpeech-1.1/mels/LJ014-0070.pt|a heavy brutish fellow, was yet aghast at his wife's resolve, and tried hard to dissuade her from bad purpose. LJSpeech-1.1/mels/LJ014-0307.pt|were intended by the protectionists to depress the wheat market, and secure the support of the farmers at the forthcoming election; LJSpeech-1.1/mels/LJ017-0144.pt|There was no convincing proof that the accused had administered the poison, although beyond question that poison had occasioned the death. LJSpeech-1.1/mels/LJ011-0163.pt|She was not in immediate danger, but she wished to see her daughter, "as it was possible she might soon become incapable of recognizing any one." LJSpeech-1.1/mels/LJ025-0061.pt|Agardh and other of the botanists of Cuvier's generation who occupied themselves with the lower plants had observed that, LJSpeech-1.1/mels/LJ004-0078.pt|"The convicted delinquent has his rights," said Mr. Buxton authoritatively. LJSpeech-1.1/mels/LJ031-0005.pt|approximately four miles from the Texas School Book Depository Building. LJSpeech-1.1/mels/LJ046-0045.pt|it is the President's right and duty to be the active leader of his party, as when he seeks to be reelected or to maintain his party in power. LJSpeech-1.1/mels/LJ014-0323.pt|The warrant thus represented money, and was often used as such, being endorsed and passed from hand to hand as other negotiable bills. LJSpeech-1.1/mels/LJ029-0047.pt|maintains records of people who have threatened the President or so conducted themselves as to be deemed a potential danger to him. LJSpeech-1.1/mels/LJ042-0123.pt|A "patriotic duty" to bring in the harvest. The opinions of the workers (unvoiced) are that it's a great pain in the neck: LJSpeech-1.1/mels/LJ019-0389.pt|passed under the more direct control of the State. LJSpeech-1.1/mels/LJ007-0199.pt|baths, fumigating places for clothing, wash-house, and the removal of dust-bins, completed the new arrangements in the main prison. LJSpeech-1.1/mels/LJ014-0117.pt|An examination of her boxes disclosed a quantity of O'Connor's property. LJSpeech-1.1/mels/LJ004-0013.pt|some prisons that had been ameliorated under the persuasive influence of his kind advice were relapsing into their former horrid state of privation, LJSpeech-1.1/mels/LJ017-0086.pt|For this purpose he gave, or there was the strongest presumption that he gave, LJSpeech-1.1/mels/LJ008-0002.pt|I propose to return now to the subject of Newgate executions, LJSpeech-1.1/mels/LJ028-0471.pt|Nebuchadnezzar says that he built it of burned bricks, but only sun-dried bricks laid in mud now appear. LJSpeech-1.1/mels/LJ044-0185.pt|He engaged in an angry argument with the consul who finally told him that, quote, as far as he was concerned LJSpeech-1.1/mels/LJ026-0094.pt|This, however, is probably not a source of vital energy, but only contributes to the maintenance of the body temperature. LJSpeech-1.1/mels/LJ004-0196.pt|There was an infirmary, properly found and duly looked after. LJSpeech-1.1/mels/LJ032-0158.pt|On November twenty-three, nineteen sixty-three, LJSpeech-1.1/mels/LJ037-0219.pt|Oswald's Jacket LJSpeech-1.1/mels/LJ008-0167.pt|No one who fell ever rose again. LJSpeech-1.1/mels/LJ008-0073.pt|One case is preserved by Catnach, LJSpeech-1.1/mels/LJ047-0134.pt|The FBI was advised by the rental agent for the Oswalds' apartment in New Orleans that they had moved again. LJSpeech-1.1/mels/LJ031-0213.pt|Under "Pathological Diagnosis" the cause of death was set forth as "Gunshot wound, head." LJSpeech-1.1/mels/LJ035-0124.pt|Neither Jarman, Norman, Williams, or Dougherty saw Oswald. LJSpeech-1.1/mels/LJ014-0190.pt|Marley, disturbed, picked up a cigar and parcel from the counter, then ran out, pursued by Lerigo only. LJSpeech-1.1/mels/LJ040-0145.pt|Dr. Hartogs did find Oswald to be a tense, withdrawn, and evasive boy who intensely disliked talking about himself and his feelings. LJSpeech-1.1/mels/LJ017-0124.pt|He frequently declared before and during the trial that it would be impossible to find him guilty. LJSpeech-1.1/mels/LJ001-0127.pt|the modern letters are narrowed by a third or thereabout; but while this gain of space very much hampers the possibility of beauty of design, LJSpeech-1.1/mels/LJ009-0122.pt|particularly to those who desire now to offer up their praises and thanksgivings for thy late mercies vouchsafed unto them. LJSpeech-1.1/mels/LJ006-0204.pt|In the same way the wardsman laid in his stock to be retailed. Other light literature besides the daily journals were in circulation: LJSpeech-1.1/mels/LJ042-0241.pt|Soon after his arrival he wrote to the Soviet Embassy in Washington LJSpeech-1.1/mels/LJ009-0229.pt|Later on, after dark, some friends of the deceased stole the body and buried it in the sand, and this was the end of hanging in chains. LJSpeech-1.1/mels/LJ014-0062.pt|He had failed in this as well as in the business of a publican, which he had at one time adopted. LJSpeech-1.1/mels/LJ026-0047.pt|circulation, metabolism, excretion, oxygenation (part of respiration), LJSpeech-1.1/mels/LJ038-0051.pt|Two patrons of the theatre and John Brewer LJSpeech-1.1/mels/LJ036-0014.pt|Oswald's Movements After Leaving Depository Building LJSpeech-1.1/mels/LJ023-0050.pt|overlook the simple fact that the President, as Chief Executive, is himself one of the three horses. LJSpeech-1.1/mels/LJ019-0125.pt|But an open farm of a thousand acres would have offered abundant chances of escape, which some at least would have attempted, probably with success. LJSpeech-1.1/mels/LJ004-0155.pt|In the crowd, all of them persons who had "no other avocation or mode of livelihood but thieving," Mr. Buxton counted eleven children LJSpeech-1.1/mels/LJ048-0173.pt|arrangements were made for building and roof security by posting police officers where appropriate. LJSpeech-1.1/mels/LJ038-0028.pt|Brewer met McDonald and the other policemen at the alley exit door, LJSpeech-1.1/mels/LJ048-0088.pt|Examination of these procedures shows that in most respects they were well conceived and ably executed by the personnel of the Service. LJSpeech-1.1/mels/LJ028-0448.pt|All of the ancient writers agree in saying that Babylon was surrounded with both inner and outer walls, and the ruins confirm their statements. LJSpeech-1.1/mels/LJ015-0165.pt|But the peer rushed forward and shook Redpath warmly by the hand. LJSpeech-1.1/mels/LJ033-0136.pt|A handmade bag of wrapping paper and tape was found in the southeast corner of the sixth floor alongside the window from which the shots were fired. LJSpeech-1.1/mels/LJ015-0226.pt|After hanging about the Folkestone office for some time, they saw at last that the key was kept in a certain cupboard. LJSpeech-1.1/mels/LJ015-0054.pt|Police officers went down at night to Nutfield, near Reigate, and arrested Sir John Paul, but allowed the prisoner to sleep there. LJSpeech-1.1/mels/LJ048-0017.pt|We satisfied ourselves that we had met our requirement, namely to find out whether he had been recruited by Soviet intelligence. The case was closed. LJSpeech-1.1/mels/LJ050-0211.pt|Chief Rowley testified that the present workload of each Secret Service agent averages one hundred ten point one cases. LJSpeech-1.1/mels/LJ012-0141.pt|Moss presently turned approver, LJSpeech-1.1/mels/LJ028-0298.pt|Surely thou hadst gone out of thy mind when thou didst so misuse thyself. LJSpeech-1.1/mels/LJ035-0112.pt|The west elevator was not on the fifth floor when Baker and Truly reached that floor, LJSpeech-1.1/mels/LJ036-0137.pt|And he never said anything. So I figured he was one of these people that don't like to talk so I never said any more to him. LJSpeech-1.1/mels/LJ038-0144.pt|that must have been some other time he picked me up, end quote, LJSpeech-1.1/mels/LJ017-0138.pt|Three years later came the case of Dr. Smethurst, LJSpeech-1.1/mels/LJ049-0221.pt|perhaps upon recommendations based on further studies by the Cabinet-level committee recommended above or the National Security Council. LJSpeech-1.1/mels/LJ031-0160.pt|The police were cautioned to prevent picture taking. LJSpeech-1.1/mels/LJ018-0138.pt|Some time in eighteen sixty-two, a large deficiency in stock of bank paper unglazed was discovered at the mills. LJSpeech-1.1/mels/LJ016-0324.pt|But it is curious to note that there were several dissentients among the commissioners to this paragraph of the report. LJSpeech-1.1/mels/LJ007-0216.pt|For nearly twenty-two hours out of the twenty-four the prisoners are locked up, during which time no officer is stationed in the ward with them. LJSpeech-1.1/mels/LJ044-0214.pt|reported Castro as saying Cuba could not accept a situation where at the same time the United States was trying to ease world tensions LJSpeech-1.1/mels/LJ045-0111.pt|They asked for Lee Oswald who was not called to the telephone because he was known by the other name. LJSpeech-1.1/mels/LJ031-0211.pt|weighed one hundred seventy pounds, had blue eyes and reddish-brown hair. LJSpeech-1.1/mels/LJ005-0046.pt|The good it tried to do took active shape in the establishment of temporary refuges -- at Hoxton for males, and in the Hackney Road for females LJSpeech-1.1/mels/LJ050-0245.pt|In view of the ever-increasing mobility of American Presidents, it seems unlikely that the Service could or should increase its own staff to a size LJSpeech-1.1/mels/LJ040-0028.pt|When he was in the United States he resented the capitalist system which he thought was exploiting him and others like him. LJSpeech-1.1/mels/LJ003-0084.pt|Quote, a common-sized man, says the keeper, Mr. Newman, can turn in nineteen inches, end quote. LJSpeech-1.1/mels/LJ007-0175.pt|but in opposition to the recorded denunciations of authority, and in defiance of the express enactments of the law, LJSpeech-1.1/mels/LJ050-0278.pt|the recommendations we have here suggested would greatly advance the security of the office without any impairment of our fundamental liberties. LJSpeech-1.1/mels/LJ014-0275.pt|but it was long before the public realized that the fraudulent clerk and the great theatrical manager were one and the same person. LJSpeech-1.1/mels/LJ005-0119.pt|No attempt was made to maintain discipline. LJSpeech-1.1/mels/LJ040-0124.pt|This continued despite the efforts of the school authorities and, to a lesser extent, of his mother to have him return to school. LJSpeech-1.1/mels/LJ006-0065.pt|were associated together, "of every variety of age, habit, and delinquency, without employment, oversight, or control." LJSpeech-1.1/mels/LJ005-0077.pt|"expedient to introduce such measures and arrangements as shall not only provide for the safe custody, LJSpeech-1.1/mels/LJ015-0039.pt|Money they must have, and money they raised to meet their urgent necessities upon the balances and securities deposited with them by their customers. LJSpeech-1.1/mels/LJ003-0258.pt|Hence the frequent cases of drunkenness, of which no notice was taken, unless people grew riotous in their cups LJSpeech-1.1/mels/LJ031-0222.pt|The surgeons observed, through X-ray analysis, thirty or forty tiny dustlike fragments of metal LJSpeech-1.1/mels/LJ048-0119.pt|The only systematic supervision of the activities of the advance agent LJSpeech-1.1/mels/LJ026-0102.pt|but root pressure due to osmosis, capillary action and evaporation from the leaves are factors. LJSpeech-1.1/mels/LJ007-0116.pt|A few others, who could not afford a payment of more than half a guinea, were permitted to monopolize a part of the prison infirmary, LJSpeech-1.1/mels/LJ023-0038.pt|The courts, however, have cast doubts on the ability of the elected Congress to protect us against catastrophe LJSpeech-1.1/mels/LJ005-0172.pt|When that time arrives LJSpeech-1.1/mels/LJ036-0114.pt|Only two of the men in the lineup with Oswald were teenagers: John T. Horn, aged eighteen, was Number one; LJSpeech-1.1/mels/LJ009-0079.pt|The sermon of this day, whether eloquent or plain, useful or useless, must produce a striking effect at the moment of its delivery. LJSpeech-1.1/mels/LJ016-0445.pt|Miller, the Chelsea murderer, who packed his victim's body in a box, and tried to send it by parcels delivery, tried to kill himself, LJSpeech-1.1/mels/LJ003-0003.pt|Prisoners were committed to it quite without reference to its capacity. LJSpeech-1.1/mels/LJ048-0278.pt|The Commission recognizes that the responsibilities of members of the White House detail of the Secret Service are arduous. LJSpeech-1.1/mels/LJ025-0032.pt|Hence arose the second great distinctive character of animals, or the circulatory system, which is less important than the digestive, LJSpeech-1.1/mels/LJ014-0280.pt|But it was proved that Watts had appropriated one cheque for fourteen hundred pounds, LJSpeech-1.1/mels/LJ025-0041.pt|and carbonic acid containing carbon and oxygen. LJSpeech-1.1/mels/LJ026-0003.pt|Nutrition thus, as has been pointed out, makes it possible to classify most organisms as animals or plants. LJSpeech-1.1/mels/LJ039-0004.pt|Chapter four. The Assassin: Part eight. LJSpeech-1.1/mels/LJ022-0060.pt|We must begin now to make provision for the future. LJSpeech-1.1/mels/LJ046-0064.pt|The President's views of his responsibilities as President of the United States were that he meet the people, that he go out to their homes and see them, LJSpeech-1.1/mels/LJ005-0114.pt|In others the separation between the sexes consisted in a hanging curtain LJSpeech-1.1/mels/LJ029-0130.pt|the President's motorcade would pass the Texas School Book Depository Building on the northwest corner of Houston and Elm Streets. LJSpeech-1.1/mels/LJ033-0106.pt|believed that he saw Oswald coming to work, but he does not remember that Oswald had anything in his hands as he entered the door. LJSpeech-1.1/mels/LJ019-0160.pt|and check by remonstrance or threat of punishment all who broke the peace of the prison. LJSpeech-1.1/mels/LJ046-0053.pt|In recent years, Presidential journeys have been frequent and extensive, LJSpeech-1.1/mels/LJ028-0238.pt|he then himself drew off with the unwarlike portion of his host, and made for the place where Nitocris dug the basin for the river, LJSpeech-1.1/mels/LJ038-0023.pt|At one:forty-five p.m., the police radio stated, quote, Have information a suspect just went in the Texas Theatre on West Jefferson, end quote. LJSpeech-1.1/mels/LJ003-0344.pt|all chances of classification and separation vanished, and the greatest evils remained untouched. LJSpeech-1.1/mels/LJ046-0156.pt|The general files of PRS consist of folders on individuals, card indexed by name. LJSpeech-1.1/mels/LJ031-0154.pt|Secret Service agents stationed at later stops on the President's itinerary of November twenty-two were redeployed. LJSpeech-1.1/mels/LJ033-0211.pt|and the obvious bulk of the package which he intended to bring to work the next day; LJSpeech-1.1/mels/LJ004-0209.pt|The looms were constantly busy. Tailors were always at work, and every article of clothing and bedding was made up within the walls. LJSpeech-1.1/mels/LJ042-0079.pt|My request for citizenship is now pending before the Supreme Soviet of the U.S.S.R. I take these steps for political reasons. LJSpeech-1.1/mels/LJ031-0142.pt|The Vice President conferred with White House Assistant Press Secretary Malcolm Kilduff LJSpeech-1.1/mels/LJ028-0107.pt|The ancients never tired of describing them. LJSpeech-1.1/mels/LJ018-0010.pt|Inside the carriage was a hat, a walking-stick, and a small black leather bag. LJSpeech-1.1/mels/LJ028-0510.pt|Probably their metal was far too valuable for the enemy to leave behind. LJSpeech-1.1/mels/LJ043-0008.pt|De Mohrenschildt was a peripheral member of the so-called Russian community, with which Oswald made contact through Mr. Peter Gregory, LJSpeech-1.1/mels/LJ034-0131.pt|a person squatting or kneeling exposes more of his body than would normally be the case. LJSpeech-1.1/mels/LJ019-0382.pt|As the years passed, great want of uniformity continued to prevail throughout the prisons of the United Kingdom. LJSpeech-1.1/mels/LJ019-0320.pt|was the boon to which willing industry extending over a long period established a certain claim. LJSpeech-1.1/mels/LJ039-0186.pt|would have been to fire three times and hit the target twice within a span of four point eight to five point six seconds. LJSpeech-1.1/mels/LJ049-0193.pt|Consequently the suggestion has been made, on the one hand, that all preventive investigative functions relating to the security of the President LJSpeech-1.1/mels/LJ021-0123.pt|When the businessmen of the country were demanding the right to organize themselves adequately to promote their legitimate interests; LJSpeech-1.1/mels/LJ001-0150.pt|the page so lay on the paper that there was more space allowed to the bottom and fore margin than to the top and back of the paper, LJSpeech-1.1/mels/LJ028-0299.pt|"Had I told thee," rejoined the other, "what I was bent on doing, thou wouldst not have suffered it; LJSpeech-1.1/mels/LJ022-0134.pt|Neither you nor I want criticism conceived in a purely fault-finding or partisan spirit, LJSpeech-1.1/mels/LJ022-0041.pt|Its first objective is to put men and women now on the relief rolls to work and, incidentally, LJSpeech-1.1/mels/LJ008-0229.pt|Above the murmur and tumult of that noisy assembly, the lowing and bleating of cattle as they were driven into the stalls and pens of Smithfield LJSpeech-1.1/mels/LJ033-0003.pt|The rifle in the building. LJSpeech-1.1/mels/LJ022-0021.pt|or to one industry, or to an individual private occupation. LJSpeech-1.1/mels/LJ050-0128.pt|Much useful information will come to the attention of local law enforcement agencies in the regular course of their activities, LJSpeech-1.1/mels/LJ047-0095.pt|On the next day, he asked the New Orleans police to arrange for him to be interviewed by the FBI. LJSpeech-1.1/mels/LJ043-0037.pt|At the time of his defection, Oswald had said that neither his brother, Robert, LJSpeech-1.1/mels/LJ012-0150.pt|Mrs. Abrahams imposed upon her father by abstracting a portion of the dust and selling it on her own account; LJSpeech-1.1/mels/LJ042-0028.pt|Oswald had managed to save enough money to cover the expenses of his forthcoming trip. LJSpeech-1.1/mels/LJ041-0080.pt|in those arguments, quote, and make himself come out top dog, end quote. LJSpeech-1.1/mels/LJ002-0068.pt|Here were also lodged the gatesmen, the prisoners who had charge of the inner gates, and who were entrusted with the duty of escorting visitors from the gates LJSpeech-1.1/mels/LJ016-0255.pt|The old prejudices, such as that which enlisted Dr. Johnson on the side of the Tyburn procession, still lingered and prevented any change. LJSpeech-1.1/mels/LJ019-0292.pt|Prisoners still slept two in a bed. LJSpeech-1.1/mels/LJ009-0156.pt|"with a view," as he himself said, "to his professional studies." LJSpeech-1.1/mels/LJ022-0199.pt|Fear is vanishing and confidence is growing on every side, LJSpeech-1.1/mels/LJ043-0071.pt|His performance for that company was satisfactory. LJSpeech-1.1/mels/LJ011-0038.pt|Fauntleroy meanwhile lay in Newgate, not herded with other condemned prisoners, as the custom was, LJSpeech-1.1/mels/LJ006-0108.pt|He charged a weekly sum as ward dues for the use of knives, forks, and plates LJSpeech-1.1/mels/LJ026-0125.pt|But the formation of starch, all important as it is, is after all only the manufacture of food LJSpeech-1.1/mels/LJ029-0041.pt|who was the Secret Service official responsible for the entire Texas journey. LJSpeech-1.1/mels/LJ039-0089.pt|in relation to the target as opposed to iron sights with aligning the sights and then aligning them on the target, end quote. LJSpeech-1.1/mels/LJ035-0120.pt|While they were at the west windows their view of the stairwell was completely blocked by shelves and boxes. LJSpeech-1.1/mels/LJ019-0360.pt|This he might do on the representation of the inspector of prisons, LJSpeech-1.1/mels/LJ032-0183.pt|The relative freshness of the fibers is strong evidence that they were caught on the rifle on the morning of the assassination or during the preceding evening. LJSpeech-1.1/mels/LJ031-0046.pt|and an extensive wound in the President's head where a sizable portion of the skull was missing. LJSpeech-1.1/mels/LJ030-0180.pt|Roy Kellerman, in the right front seat of the limousine, heard a report like a firecracker pop. LJSpeech-1.1/mels/LJ028-0051.pt|He enlarged the old city, erected temples, and began the construction of its walls. LJSpeech-1.1/mels/LJ015-0127.pt|All the signatures in the transfer were forged. Not only did he thus transfer and realize "bogus" stock LJSpeech-1.1/mels/LJ025-0082.pt|But although Cuvier's leading diagnosis of the animal from the plant will not stand a strict test, LJSpeech-1.1/mels/LJ013-0209.pt|he was annoyed with his man for various small omissions and acts of forgetfulness, and on the night of the murder had taken Courvoisier to task rather sharply. LJSpeech-1.1/mels/LJ011-0011.pt|and took the instrument out to a clerk with the ink not dry. LJSpeech-1.1/mels/LJ034-0151.pt|of what he said on November twenty-two. LJSpeech-1.1/mels/LJ039-0064.pt|An aerial photograph of Dealey Plaza shows that Elm Street runs at an angle LJSpeech-1.1/mels/LJ011-0211.pt|when indictments were preferred against both brothers "for having carried away Ellen Turner, spinster, LJSpeech-1.1/mels/LJ026-0064.pt|but unlike that of the animal, it is not chiefly an income of foods, but only of the raw materials of food. LJSpeech-1.1/mels/LJ019-0143.pt|Drinking and gaming, LJSpeech-1.1/mels/LJ010-0268.pt|It happened that a lad named Bean had absconded from his father's home some weeks before, LJSpeech-1.1/mels/LJ049-0119.pt|would be conducted by Federal law enforcement officials, in particular, the FBI with the assistance of the Secret Service. LJSpeech-1.1/mels/LJ005-0215.pt|The regular daily visitation of the chaplain was also insisted upon. LJSpeech-1.1/mels/LJ042-0204.pt|but in servile conformity to the wishes of the Soviet Union and in anticipation of Soviet Russia's complete domination of the American continent. LJSpeech-1.1/mels/LJ018-0168.pt|but proofs of Griffiths' guilt were at once apparent on entering his work-room. LJSpeech-1.1/mels/LJ002-0200.pt|The marshal was supposed to be resident either within the prison or the rules. LJSpeech-1.1/mels/LJ018-0019.pt|The stick and bag were his, but not the hat. LJSpeech-1.1/mels/LJ036-0143.pt|He marked what, he thought was the intersection of Neches and Beckley on a map of Dallas with a large "X." LJSpeech-1.1/mels/LJ028-0490.pt|He would have had to cross a deep moat, to scale a wall of burned bricks about twenty feet in thickness and perhaps three times as high, LJSpeech-1.1/mels/LJ033-0007.pt|the circumstances surrounding Oswald's return to Irving, Texas, on Thursday, November twenty-one, nineteen sixty-three, LJSpeech-1.1/mels/LJ008-0101.pt|exuberant in talk and hissing hot from Pie Corner, where she had taken her morning dose of gin-and-bitters. LJSpeech-1.1/mels/LJ014-0054.pt|a maidservant, Sarah Thomas, murdered her mistress, an aged woman, by beating out her brains with a stone. LJSpeech-1.1/mels/LJ047-0088.pt|We did not request the State Department to include Oswald on a list which would have resulted in advising us of any application for a passport LJSpeech-1.1/mels/LJ045-0158.pt|He spent quite a bit of time putting away diapers and played with the children on the street. LJSpeech-1.1/mels/LJ044-0074.pt|an agent of Bringuier's attempting to learn more about the true nature LJSpeech-1.1/mels/LJ027-0180.pt|The general similarity of the three series is complete. LJSpeech-1.1/mels/LJ046-0148.pt|that the safety of the President is or might be in danger, either at the present or in the future. LJSpeech-1.1/mels/LJ027-0012.pt|All have the same ultimate substance LJSpeech-1.1/mels/LJ042-0132.pt|Return to the United States. In view of the intensity of his earlier commitment to the Soviet Union, LJSpeech-1.1/mels/LJ016-0123.pt|got hold of the step ladder used in lighting the gas, and which under our more careful supervision would have been, as now-a-days, chained up. LJSpeech-1.1/mels/LJ045-0161.pt|He was upset over the fact that I would not answer him. LJSpeech-1.1/mels/LJ001-0179.pt|even when the woodcuts are very rude indeed, LJSpeech-1.1/mels/LJ021-0154.pt|is the program of Public Works provided for in the same Act and designed to put more men back to work, LJSpeech-1.1/mels/LJ016-0136.pt|On the other hand, at the great convict establishments, such is the moral restraint of a systematic discipline, LJSpeech-1.1/mels/LJ044-0006.pt|Although, as indicated above, the Commission has been unable to find any credible evidence LJSpeech-1.1/mels/LJ012-0092.pt|This occurred in November eighteen thirty-four. The Custom House officials were in a state of consternation, LJSpeech-1.1/mels/LJ024-0125.pt|This proposal of mine will not infringe in the slightest upon the civil or religious liberties so dear to every American. LJSpeech-1.1/mels/LJ037-0156.pt|also examined the four cartridge cases found near the site of the homicide and compared them with the test cartridge cases fired from the Smith and Wesson revolver LJSpeech-1.1/mels/LJ042-0046.pt|This should answer your question, and also give you a glimpse of my way of thinking. So you speak of advantages. Do you think that is why I am here? LJSpeech-1.1/mels/LJ040-0230.pt|There are indications that he has suffered serious personality damage but if he can receive help quickly this might be repaired to some extent, end quote. LJSpeech-1.1/mels/LJ040-0232.pt|Few social agencies even in New York were equipped to provide the kind of intensive treatment that he needed, LJSpeech-1.1/mels/LJ025-0089.pt|The third distinction is based on a completely erroneous conception of the chemical differences LJSpeech-1.1/mels/LJ023-0060.pt|and the powers given to the Congress to carry out those purposes can be best described by saying LJSpeech-1.1/mels/LJ046-0062.pt|His friend and Special Assistant Kenneth O'Donnell, who accompanied him on his last visit to Dallas, LJSpeech-1.1/mels/LJ016-0097.pt|which with Wakefield was utilized as a receptacle for convicts not going to Western Australia, LJSpeech-1.1/mels/LJ001-0054.pt|Jenson, however, had many contemporaries who used beautiful type, LJSpeech-1.1/mels/LJ046-0249.pt|about persons other than those who were obvious threats to the President. LJSpeech-1.1/mels/LJ042-0037.pt|and under which, quote, art, culture and the sprit of man are subjected to commercial enterprising, LJSpeech-1.1/mels/LJ005-0090.pt|the first by daily services, the latter by the appointment of schoolmasters and instruction in reading and writing. LJSpeech-1.1/mels/LJ029-0166.pt|On November twenty a front page story reported that the streets on which the Presidential motorcade would travel included "Main and Stemmons Freeway." LJSpeech-1.1/mels/LJ043-0035.pt|Shortly after his return from the Soviet Union, Oswald severed all relations with his mother; LJSpeech-1.1/mels/LJ041-0142.pt|Once it had started down Elm Street toward the Triple Underpass, however, LJSpeech-1.1/mels/LJ007-0036.pt|one man declared that the language of the condemned rooms was disgusting, that he was dying a death every day in being compelled to associate with such characters. LJSpeech-1.1/mels/LJ015-0278.pt|commencing sham actions, and addressing formal applications, merely for the reply. LJSpeech-1.1/mels/LJ016-0271.pt|The reply evinced equal satisfaction, and the speaker, with a profane oath, declared that he would like to act as Jack Ketch to the whole lot. LJSpeech-1.1/mels/LJ007-0093.pt|The matter was still further complicated at Newgate by the presence within the walls of sham lunatics. Some of those included in the category LJSpeech-1.1/mels/LJ009-0056.pt|The last of the four is said to have been a clergyman of the Church of England, condemned for forgery, "a miserable old man in a tattered suit of black. LJSpeech-1.1/mels/LJ050-0098.pt|determination to use a means, other than legal or peaceful, to satisfy his grievance, end quote, within the meaning of the new criteria. LJSpeech-1.1/mels/LJ018-0030.pt|Last of all, the cabman swore that he had bought the very hat found in the carriage for Müller at the hatter's, Walker's of Crawford Street. LJSpeech-1.1/mels/LJ006-0104.pt|but its issue was precarious, and dependent on the good will of the wardsmen, who measured out the portions to each according to his eye, LJSpeech-1.1/mels/LJ005-0229.pt|By another clause of the Jail Act, two justices were to be appointed to visit the prison at least thrice in every quarter, and "oftener if occasion required." LJSpeech-1.1/mels/LJ034-0196.pt|Another person who saw the assassin as the shots were fired was Amos L. Euins, age fifteen, LJSpeech-1.1/mels/LJ012-0105.pt|The police were of opinion that these robberies were both the work of the same hand. LJSpeech-1.1/mels/LJ039-0008.pt|told Robert Oswald, Lee Harvey Oswald's brother, that Oswald had once threatened to shoot former Vice President Richard M. Nixon. LJSpeech-1.1/mels/LJ011-0189.pt|the other brother was accordingly sent on a pretended mission to Shrigley to bring Mr. Turner on to London, whither Wakefield and Miss Turner also proceeded. LJSpeech-1.1/mels/LJ029-0007.pt|this chapter reviews the motorcade through Dallas, the fleeting moments of the assassination, LJSpeech-1.1/mels/LJ014-0329.pt|and so developed his business that in one year his transactions amounted to a couple of millions of pounds. LJSpeech-1.1/mels/LJ014-0225.pt|A handsome sum was subscribed for the injured constable, who was disabled for life. LJSpeech-1.1/mels/LJ016-0088.pt|working at the roof of the chapel on the female side. LJSpeech-1.1/mels/LJ008-0127.pt|As we were crossing the press yard, LJSpeech-1.1/mels/LJ001-0125.pt|this is the narrowing of the modern letters. LJSpeech-1.1/mels/LJ006-0022.pt|At that time the mild and intelligent prison discipline in force in Pennsylvania, the legacy of the old Quaker immigrants, LJSpeech-1.1/mels/LJ038-0245.pt|A photography expert with the FBI LJSpeech-1.1/mels/LJ044-0017.pt|He distributed literature in downtown New Orleans on August nine, nineteen sixty-three, LJSpeech-1.1/mels/LJ032-0273.pt|(four) a photograph taken in the yard of Oswald's apartment showed him holding this rifle, and (five) LJSpeech-1.1/mels/LJ001-0143.pt|For where these are boldly and carefully designed, and each letter is thoroughly individual in form, LJSpeech-1.1/mels/LJ003-0005.pt|no steps taken to reduce the number of committals, and the governor was obliged to utilize the chapel as a day and night room. LJSpeech-1.1/mels/LJ046-0169.pt|If the field office determines that the case should be subject to continuing review, PRS establishes a file LJSpeech-1.1/mels/LJ033-0017.pt|who also worked at the Depository. LJSpeech-1.1/mels/LJ038-0287.pt|Additional corroborative evidence. LJSpeech-1.1/mels/LJ048-0079.pt|mutual understanding of FBI and agency jurisdictions, and an indicated willingness by the agency representative LJSpeech-1.1/mels/LJ002-0017.pt|Trustworthy evidence is forthcoming to the effect that these high figures were constantly maintained for many months at a time. LJSpeech-1.1/mels/LJ047-0231.pt|some indication that the person planned to take some action against the safety of the President of the United States or the Vice President. End quote. LJSpeech-1.1/mels/LJ007-0018.pt|and that when the restraining influences of the ladies were absent, the female prisoners relapsed into immoral and uncleanly discourse. LJSpeech-1.1/mels/LJ017-0047.pt|the rest of the available space was allotted by ticket, to secure which the greatest influence was necessary. LJSpeech-1.1/mels/LJ014-0339.pt|asked Davidson and Gordon, a firm with which Cole was closely allied, whether the warrants meant goods or nothing. LJSpeech-1.1/mels/LJ022-0046.pt|It is true that while business and industry are definitely better our relief rolls are still too large. LJSpeech-1.1/mels/LJ010-0189.pt|He asked more than once whether the Queen was hurt, and acknowledged that the pistols were loaded with ball. LJSpeech-1.1/mels/LJ028-0019.pt|The stars come out one by one and shine brighter than elsewhere as if to light you on your way. LJSpeech-1.1/mels/LJ026-0021.pt|nitrogen is obtained from simple salts and the nutritive processes result in deoxidation; LJSpeech-1.1/mels/LJ002-0283.pt|and denied admission to the "charity wards," which partook of all the benefits of bequests and donations to poor debtors. LJSpeech-1.1/mels/LJ036-0047.pt|On November twenty-two, Mrs. Bledsoe came downtown to watch the Presidential motorcade. LJSpeech-1.1/mels/LJ028-0112.pt|My father did that which no previous king had done. LJSpeech-1.1/mels/LJ009-0176.pt|Seven other crimes, however, were still capital by law, and so continued till the passing of the Criminal Consolidation Acts of eighteen sixty-one. LJSpeech-1.1/mels/LJ028-0423.pt|In eighteen twelve, James Claudius Rich, the British Resident at Baghdad, made the first complete examination of the ruins. LJSpeech-1.1/mels/LJ003-0202.pt|These capital convicts, says Mr. Bennet, quote, lessened the ennui and despair of their situation by unbecoming merriment LJSpeech-1.1/mels/LJ020-0108.pt|Other things besides rising dough get on quite as well without your standing by to watch them. LJSpeech-1.1/mels/LJ014-0223.pt|The judge, in passing sentence of death, told him he richly deserved the punishment. LJSpeech-1.1/mels/LJ028-0351.pt|As for Zopyrus he was considered by Darius to have surpassed, in the greatness of his achievements, all other Persians, LJSpeech-1.1/mels/LJ028-0496.pt|rising higher and higher, like a great terraced, turreted mountain. LJSpeech-1.1/mels/LJ032-0190.pt|On the other hand Stombaugh pointed out that fibers might retain their freshness if the rifle had been LJSpeech-1.1/mels/LJ009-0181.pt|that authentic cases were known previous to the first cited act of criminals selling their own bodies to surgeons for dissection. LJSpeech-1.1/mels/LJ050-0148.pt|the increased information supplied by other agencies will be wasted. LJSpeech-1.1/mels/LJ010-0247.pt|The prisoner was conveyed without delay to the Home Office, and there examined by the Privy Council, which had been hastily summoned for the purpose. LJSpeech-1.1/mels/LJ039-0224.pt|show that he possessed ample capability to commit the assassination. LJSpeech-1.1/mels/LJ047-0108.pt|During the interview Quigley obtained background information from Oswald which was inconsistent with information already in the Bureau's possession. LJSpeech-1.1/mels/LJ017-0158.pt|She had a little fortune of her own, some one thousand seven hundred pounds or one thousand eight hundred pounds, LJSpeech-1.1/mels/LJ049-0183.pt|regarding such threats and that its Protective Research Section is not adequately staffed or equipped LJSpeech-1.1/mels/LJ031-0057.pt|While Dr. Perry was performing the tracheotomy, Drs. Carrico and Ronald Jones made cutdowns on the President's right leg and left arm, respectively, LJSpeech-1.1/mels/LJ004-0158.pt|All were in ill health; almost all were in rags; almost all were filthy in the extreme. LJSpeech-1.1/mels/LJ043-0050.pt|As Marguerite Oswald testified, quote, LJSpeech-1.1/mels/LJ023-0119.pt|that will refuse to amend the Constitution by the arbitrary exercise of judicial power -- amended by judicial say-so. LJSpeech-1.1/mels/LJ021-0015.pt|The underlying necessity for such activity LJSpeech-1.1/mels/LJ027-0125.pt|in the Python we find very tiny rudiments of the hindlimbs. Now, LJSpeech-1.1/mels/LJ016-0153.pt|would make death a certainty, so limited and imperfect are the means generally available. LJSpeech-1.1/mels/LJ040-0172.pt|Mrs. Siegel concluded that Lee, quote, just felt that his mother never gave a damn for him. LJSpeech-1.1/mels/LJ040-0159.pt|who suffers under the impact of really existing emotional isolation LJSpeech-1.1/mels/LJ028-0087.pt|Such was the appearance of the builder of the walls of Babylon. LJSpeech-1.1/mels/LJ048-0233.pt|Two of the nine agents returned to their rooms. The seven others proceeded to an establishment called the Cellar Coffee House, LJSpeech-1.1/mels/LJ038-0288.pt|The admissions made to Marina Oswald by her husband are an important element in the evidence that Lee Harvey Oswald fired the shot at General Walker. LJSpeech-1.1/mels/LJ008-0199.pt|At the George public-house to the south of the drop, Sir W. Watkin Wynn, Baronet, LJSpeech-1.1/mels/LJ029-0188.pt|Stevenson was jeered, jostled, and spat upon by hostile demonstrators outside the Dallas Memorial Auditorium Theater. LJSpeech-1.1/mels/LJ012-0132.pt|and he with his father arranged that a messenger should call for the stuff with forged credentials, and anticipating the rightful owner. LJSpeech-1.1/mels/LJ033-0139.pt|Oswald's Mannlicher-Carcano rifle, serial Number C two seven six six, which was also found on the sixth floor. LJSpeech-1.1/mels/LJ048-0085.pt|the Commission believes that the liaison between all Federal agencies responsible for Presidential protection should be improved. LJSpeech-1.1/mels/LJ006-0209.pt|the donation of a philanthropic gentleman, Captain Brown, but these, particularly the Bibles, bore little appearance of having been used. LJSpeech-1.1/mels/LJ028-0283.pt|As soon therefore as he felt within himself that Babylon was fated to be taken, he went to Darius and asked him if he set a very high value on its conquest. LJSpeech-1.1/mels/LJ016-0071.pt|Dissatisfied with this remuneration, he again took to the road, and tramped into Hampshire, LJSpeech-1.1/mels/LJ043-0064.pt|which were largely of his own making. LJSpeech-1.1/mels/LJ043-0039.pt|He also indicated to officials at the American Embassy in Moscow that his defection was motivated at least in part LJSpeech-1.1/mels/LJ041-0182.pt|and believed that our Government did not have, quote, too much to offer, end quote, but was not in favor of, quote, the Communist way of life, end quote. LJSpeech-1.1/mels/LJ005-0060.pt|The Society did not limit its remarks to the description of what had already been done LJSpeech-1.1/mels/LJ036-0131.pt|And about that time an old lady, I think she was an old lady, I don't remember nothing but her sticking her head down past him in the door and said, LJSpeech-1.1/mels/LJ026-0067.pt|We have here the direct absorption into the body proper of food-stuffs precisely as the animal takes in water and oxygen. LJSpeech-1.1/mels/LJ012-0180.pt|The murderer explained that he had first fired a pistol at Weare's head, but the shot glanced off his cheek. LJSpeech-1.1/mels/LJ047-0161.pt|Mrs. Paine told Hosty also LJSpeech-1.1/mels/LJ008-0131.pt|the other he kept between his hands. LJSpeech-1.1/mels/LJ034-0190.pt|Robert Edwards said that, while looking at the south side of the Depository Building shortly before the motorcade, LJSpeech-1.1/mels/LJ041-0074.pt|John E. Donovan, one of his former officers, testified that Oswald thought, quote, LJSpeech-1.1/mels/LJ022-0051.pt|In spite of the fact that unemployment remains a serious problem LJSpeech-1.1/mels/LJ027-0166.pt|retain permanently this form, and are therefore called "perennibranchs," but the frog still passes on. LJSpeech-1.1/mels/LJ038-0249.pt|Investigation determined that this photograph was taken approximately seven-tenths of a mile from Walker's house. LJSpeech-1.1/mels/LJ034-0214.pt|Investigation has established that Altgens' picture was taken approximately two seconds after the firing of the shot LJSpeech-1.1/mels/LJ046-0077.pt|Under our system, measures must be sought to afford security without impeding the President's performance of his many functions. LJSpeech-1.1/mels/LJ006-0121.pt|for a petition of from one shilling, half pence to eight shillings, according to its length, LJSpeech-1.1/mels/LJ037-0060.pt|That Mrs. Markham described the man who killed Patrolman Tippit as, quote, short, a little on the heavy side, end quote. LJSpeech-1.1/mels/LJ023-0064.pt|Having in mind that in succeeding generations many other problems then undreamed of would become national problems LJSpeech-1.1/mels/LJ005-0211.pt|the jail consisted of six cells, frequently so damp that the moisture trickled down the walls; there was not space for air or exercise, LJSpeech-1.1/mels/LJ036-0121.pt|a twelve:fifteen p.m. pickup at Continental to Greyhound, unloaded at twelve:thirty p.m., LJSpeech-1.1/mels/LJ029-0002.pt|Chapter two. The Assassination: Part one. LJSpeech-1.1/mels/LJ038-0010.pt|a recessed area extending about fifteen feet between the sidewalk and the front door of his store. LJSpeech-1.1/mels/LJ023-0018.pt|We also became convinced that the only way to avoid a repetition of those dark days was to have a government with power to prevent LJSpeech-1.1/mels/LJ018-0119.pt|His offer was not, however, accepted. LJSpeech-1.1/mels/LJ002-0304.pt|The sheriff demanded four shillings, six pence for his liberate, the jailer six shillings, ten pence more, and the turnkey two shillings; LJSpeech-1.1/mels/LJ019-0342.pt|So was the employment of prisoners in any position of trust or authority; LJSpeech-1.1/mels/LJ043-0131.pt|As a result Oswald was not hired. LJSpeech-1.1/mels/LJ035-0048.pt|I can't say whether he had gone on through that door [the lunchroom door] or not. LJSpeech-1.1/mels/LJ047-0050.pt|Oswald again agreed to advise the FBI if he were approached under suspicious circumstances; however, he deprecated the possibility of this happening, LJSpeech-1.1/mels/LJ027-0045.pt|careful study shows detailed internal as well as external similarities of structure. Such cases are "homologies". LJSpeech-1.1/mels/LJ005-0139.pt|making an average of nineteen persons occupying each room. LJSpeech-1.1/mels/LJ044-0060.pt|In view of the limited amount of public activity on Oswald's part before August nine, nineteen sixty-three, LJSpeech-1.1/mels/LJ050-0070.pt|The FBI now transmits information on all defectors, a category which would, of course, have included Oswald. LJSpeech-1.1/mels/LJ009-0275.pt|who bad been further upset by a letter threatening to shoot him when he appeared to perform his task. LJSpeech-1.1/mels/LJ025-0066.pt|and his skepticism was the more justified since Ehrenberg in his elaborate and comprehensive work on the infusoria, LJSpeech-1.1/mels/LJ039-0240.pt|On the basis of the evidence reviewed in this chapter, the Commission has found that Lee Harvey Oswald (one) LJSpeech-1.1/mels/LJ029-0144.pt|In conformity with these arrangements, traffic proceeding west on Main is directed to turn right at Houston LJSpeech-1.1/mels/LJ015-0117.pt|Sergeant Ballantine, who prosecuted, LJSpeech-1.1/mels/LJ019-0322.pt|On the other hand, new and careful regulations were framed to secure the moral and material well-being of the inmates of the jails. LJSpeech-1.1/mels/LJ028-0155.pt|Lumps of bitumen are found in great abundance in this river. LJSpeech-1.1/mels/LJ011-0073.pt|several persons were sentenced to or suffered death for this crime. LJSpeech-1.1/mels/LJ009-0210.pt|On the left side of the head the fatal mall, LJSpeech-1.1/mels/LJ023-0134.pt|and reject the legislative powers which the courts have today assumed. LJSpeech-1.1/mels/LJ026-0117.pt|are directly oxidized to excretions and, lacking nitrogen, cannot serve for making new animal protoplasm. LJSpeech-1.1/mels/LJ014-0296.pt|He had made use of a piece of rope cut out from the sacking of his bedstead, and had tied his feet together with a silk pocket-handkerchief. LJSpeech-1.1/mels/LJ017-0126.pt|He relied on the absence of the strychnia. LJSpeech-1.1/mels/LJ034-0103.pt|This description most probably led to the radio alert sent to police cars at approximately twelve:forty-five p.m., which described the suspect as white, LJSpeech-1.1/mels/LJ007-0140.pt|The primary object of committing a prisoner to jail, as the inspectors pointed out, was to deter not only the criminal himself, but others from crime, LJSpeech-1.1/mels/LJ040-0231.pt|Lee Oswald never received that help. LJSpeech-1.1/mels/LJ033-0039.pt|and one which provided an excuse for the carrying of a bulky package the following morning. LJSpeech-1.1/mels/LJ050-0143.pt|county, and State law enforcement agencies in their districts. LJSpeech-1.1/mels/LJ001-0093.pt|This experiment was so far successful that about eighteen fifty Messrs. Miller and Richard of Edinburgh LJSpeech-1.1/mels/LJ048-0118.pt|He did not have a checklist of the tasks he was expected to accomplish, either by his own efforts or with the cooperation of local authorities. LJSpeech-1.1/mels/LJ005-0176.pt|which possessed the right of trying criminals for various offenses. LJSpeech-1.1/mels/LJ003-0158.pt|from whom still higher fees were exacted, with the same discreditable idea of swelling the revenues of the prison. LJSpeech-1.1/mels/LJ047-0115.pt|Several days later, the Bureau received additional evidence that Oswald had lied to Agent Quigley.
TensorFlow/LanguageModeling/BERT/triton
triton
README
# Deploying the BERT TensorFlow model using Triton Inference Server This folder contains instructions for deployment and exemplary client application to run inference on Triton Inference Server as well as detailed performance analysis. ## Table Of Contents * [Solution Overview](#solution-overview) * [Setup](#setup) * [Quick Start Guide](#quick-start-guide) * [Advanced](#advanced) * [Running the Triton Inference Server](#running-the-triton-inference-server) * [Running the Triton Inference Client](#running-the-triton-inference-client) * [Performance](#performance) * [Latency vs Throughput for TensorRT Engine](#latency-vs-throughput-for-tensorrt-engine) * [Dynamic batching support](#dynamic-batching-support) ## Solution overview The [NVIDIA Triton Inference Server](https://github.com/NVIDIA/triton-inference-server) provides a datacenter and cloud inferencing solution optimized for NVIDIA GPUs. The server provides an inference service via an HTTP/REST or gRPC endpoint, or by a C API endpoint, allowing remote clients to request inferencing for any number of GPU or CPU models being managed by the server. A typical Triton Inference Server pipeline can be broken down into the following steps: 1. The client serializes the inference request into a message and sends it to the server (Client Send). 2. The message travels over the network from the client to the server (Network). 3. The message arrives at the server, and is deserialized (Server Receive). 4. The request is placed in the queue (Server Queue). 5. The request is removed from the queue and computed (Server Compute). 6. The completed request is serialized in a message and sent back to the client (Server Send). 7. The completed message then travels over the network from the server to the client (Network). 8. The completed message is deserialized by the client and processed as a completed inference request (Client Receive). Generally, for local clients, steps 1-4 and 6-8 will only occupy a small fraction of time, compared to steps 5-6. As backend deep learning systems like BERT are rarely exposed directly to end users, but instead only interfacing with local front-end servers, for the sake of BERT, we can consider that all clients are local. In this section, we will go over how to launch both the Triton Inference Server and the client and get the best performance solution that fits your specific application needs. More information on how to perform inference using NVIDIA Triton Inference Server can be found in [triton/README.md](https://github.com/NVIDIA/DeepLearningExamples/blob/master/PyTorch/LanguageModeling/BERT/triton/README.md). ## Setup The repository contains a folder `./triton/` with a `Dockerfile` which extends the latest TensorFlow NGC container and encapsulates some dependencies. Ensure you have the following components: * [NVIDIA Docker](https://github.com/NVIDIA/nvidia-docker) * [TensorFlow NGC container](https://ngc.nvidia.com/catalog/containers/nvidia:tensorflow) * [Triton Inference Server NGC container 20.09](https://ngc.nvidia.com/catalog/containers/nvidia:tritonserver) * [NVIDIA CUDA repository]([https://docs.nvidia.com/cuda/archive/10.2/index.html](https://docs.nvidia.com/cuda/archive/10.2/index.html)) for NVIDIA TensorRT 7.1.3 * [NVIDIA Volta](https://www.nvidia.com/en-us/data-center/volta-gpu-architecture/) or [Turing](https://www.nvidia.com/en-us/geforce/turing/) based GPU ## Quick Start Guide Running the following scripts will build and launch the container containing all required dependencies for native TensorFlow as well as Triton. This is necessary for running inference and can also be used for data download, processing, and training of the model. For more information on the scripts and arguments, refer to the [Advanced](#advanced) section. 1. Clone the repository. ```bash git clone https://github.com/NVIDIA/DeepLearningExamples cd DeepLearningExamples/TensorFlow/LanguageModeling/BERT ``` 2. Build a container that extends NGC TensorFlow, Triton Inference Server, and Triton Inference Client. ```bash bash scripts/docker/build.sh ``` 3. Download fine-tuned checkpoints and SQuAD dataset. To download the data to `data/download`, run: ```bash bash scripts/docker/launch.sh triton/scripts/triton_data_download.sh ``` 4. Run inference. The Triton Inference Server can serve either of the following two BERT models: 4.1. TensorFlow SavedModel The `run_triton_tf.sh` script starts the server on a local host in a detached state, runs the client on the SQuAD v1.1 dataset and then evaluates the validity of predictions on the basis of the exact match and F1 score all in one step. The script exports the TensorFlow BERT model checkpoint as a `tensorflow_savedmodel` that Triton Inference Server accepts and builds a matching [Triton Inference Server model config](https://docs.nvidia.com/deeplearning/sdk/triton-inference-server-guide/docs/model_configuration.html) when `triton_export_model` is set to `true`. ```bash bash triton/scripts/run_triton_tf.sh <init_checkpoint> <batch_size> <precision> <use_xla> <seq_length> <doc_stride> <bert_model> <squad_version> <triton_version_name> <triton_model_name> <triton_export_model> <triton_dyn_batching_delay> <triton_engine_count> <triton_model_overwrite> ``` Refer to the advanced section for details on launching client and server separately for debugging. 4.2. TensorRT Model In order to use the BERT TensorRT engine, follow the steps underlined in [TensorRT Repository](https://github.com/NVIDIA/TensorRT/tree/master/demo/BERT) to build a TensorRT engine. Place it as `results/triton_models/<triton_model_name>/<triton_version_name>/model.plan` and use the `run_triton_trt.sh` script as follows. ```bash bash triton/scripts/run_triton_trt.sh <batch_size> <seq_length> <doc_stride> <bert_model> <squad_version> <triton_version_name> <triton_model_name> ``` Notes: - [Triton Inference Server 20.09](https://docs.nvidia.com/deeplearning/triton-inference-server/release-notes/rel_20-09.html#rel_20-09) is compatible with [TensorRT 7.1.3](https://docs.nvidia.com/deeplearning/tensorrt/release-notes/index.html). - The current Triton Inference Server works with the TensorRT engine with `batch_size > 1`. - To use the performance client with dynamic batching, build an engine with -b <N> -b <N+1>` to support dynamic batches upto size N. ## Advanced The following sections provide greater details about the Triton Inference Server pipeline and inference analysis and benchmarking results. ### Running the Triton Inference Server Launch the Triton Inference Server in detached mode to run in background by default. To run in the foreground interactively, for debugging purposes, run: ```bash DETACHED=”-it” bash scripts/docker/launch_server.sh ``` The script mounts and loads models at `$PWD/results/triton_models` to the server with all visible GPUs. In order to selectively choose the devices, set `NVIDIA_VISIBLE_DEVICES`. ### Running the Triton Inference Client *Real data* In order to run the client with real data, run: ```bash bash triton/scripts/run_client.sh <batch_size> <seq_length> <doc_stride> <triton_version_name> <triton_model_name> <BERT_DIR> <ADDITIONAL_ARGS> ``` The script calls `triton/run_squad_triton_client.py` which preprocesses data and sends/receives requests to/from the server. `ADDITIONAL_ARGS` must include either `--predict_file` to use the SQuAD dataset or a sample by passing `--question` and `--context`. Append with `--trt_engine` if running inference on a TensorRT engine server. *Synthetic data* In order to run the client with synthetic data for performance measurements, run: ```bash bash triton/scripts/run_perf_client.sh <model_name> <model_version> <batch_size> <max_latency> <max_client_threads> <max_concurrency> <server_hostname> ``` The script waits until the server is up and running, sends requests as per the constraints set and writes results to `OUTPUT_FILE_CSV="/results/perf_client/${MODEL_NAME}/results_${TIMESTAMP}.csv`. For more information about `perf_client`, refer to the [official documentation](https://docs.nvidia.com/deeplearning/triton-inference-server/master-user-guide/docs/optimization.html#perf-client). ## Performance The performance measurements in this document were conducted at the time of publication and may not reflect the performance achieved from NVIDIA’s latest software release. For the most up-to-date performance measurements, go to [NVIDIA Data Center Deep Learning Product Performance](https://developer.nvidia.com/deep-learning-performance-training-inference). ### Latency vs Throughput for TensorRT Engine Performance numbers for BERT Large, sequence length=384 are obtained from [experiments](https://github.com/NVIDIA/TensorRT/tree/release/7.1/demo/BERT#inference-performance-nvidia-a100-40gb) on NVIDIA A100 with 1x A100 40G GPUs. Throughput is measured in samples/second, and latency in milliseconds. ![](../data/images/bert_trt_throughput_vs_latency.png?raw=true) The plot above shows that throughput gains taper off from increasing batch size above 12. There is minimal gain in throughput going from batch size 12 to 128. However, running inference with a single large batch might be faster than running several small inference requests. Therefore, we choose to maximize batch size for Dynamic Batching with a maximum acceptable queuing delay of 1ms and maximum acceptable inference latency of 100ms. ### Dynamic Batching Support The Triton server has a dynamic batching mechanism built in, that can be enabled. When it is enabled, the server creates inference batches from the received requests. With dynamic batching enabled, the server will concatenate requests that come in within maximum queue delay time, into a single inference batch. To configure these parameters and run dynamic batching for a model, issue: ```bash #Set server config for dynamic batching with maximum queue delay echo "dynamic_batching { max_queue_delay_microseconds: 1000 }" >> results/triton_models/bert/config.pbtxt #Launch Server DETACHED="-it" bash triton/scripts/launch_server.sh #Run perf client in another terminal bash triton/scripts/run_perf_client.sh bert 1 12 ``` Note that the TensorRT engine takes 30+ minutes to build depending on the profile size. Loading it on TRITON server can be sped up by only loading only on required GPUs. Performance results on a single A100 40G for various numbers of simultaneous requests are shown in the figure below. ![](../data/images/bert_triton_dynamic_batching_a100.png?raw=true) The plot above shows that if we have a 100ms upper bound on latency, then a single GPU can handle up to 9 concurrent requests before throughput saturates. This leads to total throughput of ~1045 sequences per second. ## Release Notes ### Changelog October 2020 Add scripts to use TensorRT engines for inference September 2020 Update to TRITON 20.08 April 2020 TRTIS -> TRITON October 2019 Initial release
PyTorch/Forecasting/TFT/triton
triton
README
# Deploying the TFT model on Triton Inference Server This folder contains instructions for deployment to run inference on Triton Inference Server as well as a detailed performance analysis. The purpose of this document is to help you with achieving the best inference performance. ## Table of contents - [Solution overview](#solution-overview) - [Introduction](#introduction) - [Deployment process](#deployment-process) - [Setup](#setup) - [Quick Start Guide](#quick-start-guide) - [Performance](#performance) - [Offline scenario](#offline-scenario) - [Offline: NVIDIA A30, NVIDIA TensorRT with FP16, Dataset: electricity](#offline-nvidia-a30-nvidia-tensorrt-with-fp16-dataset-electricity) - [Offline: NVIDIA A30, NVIDIA TensorRT with FP16, Dataset: traffic](#offline-nvidia-a30-nvidia-tensorrt-with-fp16-dataset-traffic) - [Offline: NVIDIA A30, PyTorch with FP16, Dataset: electricity](#offline-nvidia-a30-pytorch-with-fp16-dataset-electricity) - [Offline: NVIDIA A30, PyTorch with FP16, Dataset: traffic](#offline-nvidia-a30-pytorch-with-fp16-dataset-traffic) - [Offline: NVIDIA DGX-1 (1x V100 32GB), NVIDIA TensorRT with FP16, Dataset: electricity](#offline-nvidia-dgx-1-1x-v100-32gb-nvidia-tensorrt-with-fp16-dataset-electricity) - [Offline: NVIDIA DGX-1 (1x V100 32GB), NVIDIA TensorRT with FP16, Dataset: traffic](#offline-nvidia-dgx-1-1x-v100-32gb-nvidia-tensorrt-with-fp16-dataset-traffic) - [Offline: NVIDIA DGX-1 (1x V100 32GB), PyTorch with FP16, Dataset: electricity](#offline-nvidia-dgx-1-1x-v100-32gb-pytorch-with-fp16-dataset-electricity) - [Offline: NVIDIA DGX-1 (1x V100 32GB), PyTorch with FP16, Dataset: traffic](#offline-nvidia-dgx-1-1x-v100-32gb-pytorch-with-fp16-dataset-traffic) - [Offline: NVIDIA DGX A100 (1x A100 80GB), NVIDIA TensorRT with FP16, Dataset: electricity](#offline-nvidia-dgx-a100-1x-a100-80gb-nvidia-tensorrt-with-fp16-dataset-electricity) - [Offline: NVIDIA DGX A100 (1x A100 80GB), NVIDIA TensorRT with FP16, Dataset: traffic](#offline-nvidia-dgx-a100-1x-a100-80gb-nvidia-tensorrt-with-fp16-dataset-traffic) - [Offline: NVIDIA DGX A100 (1x A100 80GB), PyTorch with FP16, Dataset: electricity](#offline-nvidia-dgx-a100-1x-a100-80gb-pytorch-with-fp16-dataset-electricity) - [Offline: NVIDIA DGX A100 (1x A100 80GB), PyTorch with FP16, Dataset: traffic](#offline-nvidia-dgx-a100-1x-a100-80gb-pytorch-with-fp16-dataset-traffic) - [Offline: NVIDIA T4, NVIDIA TensorRT with FP16, Dataset: electricity](#offline-nvidia-t4-nvidia-tensorrt-with-fp16-dataset-electricity) - [Offline: NVIDIA T4, NVIDIA TensorRT with FP16, Dataset: traffic](#offline-nvidia-t4-nvidia-tensorrt-with-fp16-dataset-traffic) - [Offline: NVIDIA T4, PyTorch with FP16, Dataset: electricity](#offline-nvidia-t4-pytorch-with-fp16-dataset-electricity) - [Offline: NVIDIA T4, PyTorch with FP16, Dataset: traffic](#offline-nvidia-t4-pytorch-with-fp16-dataset-traffic) - [Online scenario](#online-scenario) - [Online: NVIDIA A30, NVIDIA TensorRT with FP16, Dataset: electricity](#online-nvidia-a30-nvidia-tensorrt-with-fp16-dataset-electricity) - [Online: NVIDIA A30, NVIDIA TensorRT with FP16, Dataset: traffic](#online-nvidia-a30-nvidia-tensorrt-with-fp16-dataset-traffic) - [Online: NVIDIA A30, PyTorch with FP16, Dataset: electricity](#online-nvidia-a30-pytorch-with-fp16-dataset-electricity) - [Online: NVIDIA A30, PyTorch with FP16, Dataset: traffic](#online-nvidia-a30-pytorch-with-fp16-dataset-traffic) - [Online: NVIDIA DGX-1 (1x V100 32GB), NVIDIA TensorRT with FP16, Dataset: electricity](#online-nvidia-dgx-1-1x-v100-32gb-nvidia-tensorrt-with-fp16-dataset-electricity) - [Online: NVIDIA DGX-1 (1x V100 32GB), NVIDIA TensorRT with FP16, Dataset: traffic](#online-nvidia-dgx-1-1x-v100-32gb-nvidia-tensorrt-with-fp16-dataset-traffic) - [Online: NVIDIA DGX-1 (1x V100 32GB), PyTorch with FP16, Dataset: electricity](#online-nvidia-dgx-1-1x-v100-32gb-pytorch-with-fp16-dataset-electricity) - [Online: NVIDIA DGX-1 (1x V100 32GB), PyTorch with FP16, Dataset: traffic](#online-nvidia-dgx-1-1x-v100-32gb-pytorch-with-fp16-dataset-traffic) - [Online: NVIDIA DGX A100 (1x A100 80GB), NVIDIA TensorRT with FP16, Dataset: electricity](#online-nvidia-dgx-a100-1x-a100-80gb-nvidia-tensorrt-with-fp16-dataset-electricity) - [Online: NVIDIA DGX A100 (1x A100 80GB), NVIDIA TensorRT with FP16, Dataset: traffic](#online-nvidia-dgx-a100-1x-a100-80gb-nvidia-tensorrt-with-fp16-dataset-traffic) - [Online: NVIDIA DGX A100 (1x A100 80GB), PyTorch with FP16, Dataset: electricity](#online-nvidia-dgx-a100-1x-a100-80gb-pytorch-with-fp16-dataset-electricity) - [Online: NVIDIA DGX A100 (1x A100 80GB), PyTorch with FP16, Dataset: traffic](#online-nvidia-dgx-a100-1x-a100-80gb-pytorch-with-fp16-dataset-traffic) - [Online: NVIDIA T4, NVIDIA TensorRT with FP16, Dataset: electricity](#online-nvidia-t4-nvidia-tensorrt-with-fp16-dataset-electricity) - [Online: NVIDIA T4, NVIDIA TensorRT with FP16, Dataset: traffic](#online-nvidia-t4-nvidia-tensorrt-with-fp16-dataset-traffic) - [Online: NVIDIA T4, PyTorch with FP16, Dataset: electricity](#online-nvidia-t4-pytorch-with-fp16-dataset-electricity) - [Online: NVIDIA T4, PyTorch with FP16, Dataset: traffic](#online-nvidia-t4-pytorch-with-fp16-dataset-traffic) - [Advanced](#advanced) - [Step by step deployment process](#step-by-step-deployment-process) - [Latency explanation](#latency-explanation) - [Release notes](#release-notes) - [Changelog](#changelog) - [Known issues](#known-issues) ## Solution overview ### Introduction The [NVIDIA Triton Inference Server](https://github.com/NVIDIA/triton-inference-server) provides a datacenter and cloud inferencing solution optimized for NVIDIA GPUs. The server provides an inference service via an HTTP or gRPC endpoint, allowing remote clients to request inferencing for any number of GPU or CPU models being managed by the server. This README provides step-by-step deployment instructions for models generated during training (as described in the [model README](../readme.md)). Additionally, this README provides the corresponding deployment scripts that ensure optimal GPU utilization during inferencing on Triton Inference Server. ### Deployment process The deployment process consists of two steps: 1. Conversion. The purpose of conversion is to find the best performing model format supported by Triton Inference Server. Triton Inference Server uses a number of runtime backends such as [TensorRT](https://developer.nvidia.com/tensorrt), [LibTorch](https://github.com/triton-inference-server/pytorch_backend) and [ONNX Runtime](https://github.com/triton-inference-server/onnxruntime_backend) to support various model types. Refer to the [Triton documentation](https://github.com/triton-inference-server/backend#where-can-i-find-all-the-backends-that-are-available-for-triton) for a list of available backends. 2. Configuration. Model configuration on Triton Inference Server, which generates necessary [configuration files](https://github.com/triton-inference-server/server/blob/master/docs/model_configuration.md). After deployment Triton inference server is used for evaluation of converted model in two steps: 1. Accuracy tests. Produce results which are tested against given accuracy thresholds. 2. Performance tests. Produce latency and throughput results for offline (static batching) and online (dynamic batching) scenarios. All steps are executed by provided runner script. Refer to [Quick Start Guide](#quick-start-guide) ## Setup Ensure you have the following components: * [NVIDIA Docker](https://github.com/NVIDIA/nvidia-docker) * [PyTorch NGC container 21.12](https://catalog.ngc.nvidia.com/orgs/nvidia/containers/pytorch) * [Triton Inference Server NGC container 21.12](https://ngc.nvidia.com/catalog/containers/nvidia:tritonserver) * [NVIDIA CUDA](https://docs.nvidia.com/cuda/archive//index.html) * [NVIDIA Ampere](https://www.nvidia.com/en-us/data-center/nvidia-ampere-gpu-architecture/), [Volta](https://www.nvidia.com/en-us/data-center/volta-gpu-architecture/) or [Turing](https://www.nvidia.com/en-us/geforce/turing/) based GPU ## Quick Start Guide Running the following scripts will build and launch the container with all required dependencies for native PyTorch as well as Triton Inference Server. This is necessary for running inference and can also be used for data download, processing, and training of the model. 1. Clone the repository. ``` git clone https://github.com/NVIDIA/DeepLearningExamples.git cd DeepLearningExamples/PyTorch/Forecasting/TFT ``` 2. Prepare dataset. Please use the data download from the [Main QSG](https://github.com/NVIDIA/DeepLearningExamples/tree/master/PyTorch/Forecasting/TFT#quick-start-guide) 3. Build and run a container that extends NGC PyTorch with the Triton client libraries and necessary dependencies. ``` bash ./triton/scripts/docker/build.sh bash ./triton/scripts/docker/interactive.sh /path/to/your/data/ ``` 4. Execute runner script (please mind, the run scripts are prepared per NVIDIA GPU). ``` NVIDIA A30: bash ./triton/runner/start_NVIDIA-A30.sh NVIDIA DGX-1 (1x V100 32GB): bash ./triton/runner/start_NVIDIA-DGX-1-\(1x-V100-32GB\).sh NVIDIA DGX A100 (1x A100 80GB): bash ./triton/runner/start_NVIDIA-DGX-A100-\(1x-A100-80GB\).sh NVIDIA T4: bash ./triton/runner/start_NVIDIA-T4.sh ``` If one encounters an error like `the provided PTX was compiled with an unsupported toolchain`, follow the steps in [Step by step deployment process](#step-by-step-deployment-process). ## Performance The performance measurements in this document were conducted at the time of publication and may not reflect the performance achieved from NVIDIA’s latest software release. For the most up-to-date performance measurements, go to [NVIDIA Data Center Deep Learning Product Performance](https://developer.nvidia.com/deep-learning-performance-training-inference). ### Offline scenario The offline scenario assumes the client and server are located on the same host. The tests uses: - tensors are passed through shared memory between client and server, the Perf Analyzer flag `shared-memory=system` is used - single request is send from client to server with static size of batch #### Offline: NVIDIA A30, NVIDIA TensorRT with FP16, Dataset: electricity Our results were obtained using the following configuration: | Parameter Name | Parameter Value | |:-----------------------------|:-----------------------------| | GPU |NVIDIA A30 | | Backend |NVIDIA TensorRT | | Precision |FP16 | | Model format |NVIDIA TensorRT | | Max batch size |1024 | | Number of model instances |2| | Export Precision | FP32 | | NVIDIA TensorRT Capture CUDA Graph | Disabled | | Dataset | electricity | | Device | gpu | | Request Count | 500 | <table> <tbody> <tr> <td colspan="2" align="center"><img src="./reports/nvidia_a30_experiment_17_triton_performance_offline_17/plots/throughput_vs_latency.png"></td> </tr> </tbody> </table> <details> <summary>Results Table</summary> | Batch | Concurrency | Inferences/Second | Client Send (ms) | Network+Server Send/Recv (ms) | Server Queue (ms) | Server Compute Input (ms) | Server Compute Infer (ms) | Server Compute Output (ms) | Client Recv (ms) | p50 latency (ms) | p90 latency (ms) | p95 latency (ms) | p99 latency (ms) | avg latency (ms) | |--------:|--------------:|--------------------:|-------------------:|--------------------------------:|--------------------:|----------------------------:|----------------------------:|-----------------------------:|-------------------:|-------------------:|-------------------:|-------------------:|-------------------:|-------------------:| | 1 | 1 | 595.0 | 0.0 | 0.2 | 0.1 | 0.1 | 1.3 | 0.0 | 0.0 | 1.7 | 1.7 | 1.8 | 1.8 | 1.7 | | 2 | 1 | 804.6 | 0.0 | 0.1 | 0.0 | 0.1 | 2.1 | 0.1 | 0.0 | 2.5 | 2.6 | 2.6 | 2.6 | 2.5 | | 4 | 1 | 1500.0 | 0.0 | 0.2 | 0.1 | 0.1 | 2.2 | 0.1 | 0.0 | 2.7 | 2.7 | 2.7 | 2.8 | 2.7 | | 8 | 1 | 2696.0 | 0.1 | 0.2 | 0.1 | 0.1 | 2.5 | 0.0 | 0.0 | 2.9 | 3.0 | 3.1 | 3.3 | 3.0 | | 16 | 1 | 4704.0 | 0.1 | 0.2 | 0.1 | 0.1 | 2.9 | 0.0 | 0.0 | 3.4 | 3.5 | 3.6 | 3.8 | 3.4 | | 32 | 1 | 8576.0 | 0.1 | 0.2 | 0.0 | 0.1 | 3.2 | 0.1 | 0.0 | 3.7 | 3.9 | 3.9 | 4.0 | 3.7 | | 64 | 1 | 14101.3 | 0.1 | 0.2 | 0.0 | 0.1 | 4.0 | 0.0 | 0.0 | 4.5 | 4.6 | 4.7 | 5.2 | 4.5 | | 128 | 1 | 19227.2 | 0.1 | 0.2 | 0.1 | 0.1 | 6.1 | 0.0 | 0.0 | 6.5 | 6.7 | 8.0 | 8.3 | 6.6 | | 256 | 1 | 24401.3 | 0.1 | 0.3 | 0.1 | 0.2 | 9.8 | 0.0 | 0.0 | 10.4 | 10.5 | 11.4 | 11.6 | 10.5 | | 512 | 1 | 27235.7 | 0.1 | 0.4 | 0.1 | 1.0 | 17.1 | 0.1 | 0.0 | 18.8 | 18.8 | 18.8 | 18.8 | 18.8 | | 1024 | 1 | 28782.6 | 0.1 | 0.4 | 0.1 | 1.9 | 32.9 | 0.2 | 0.0 | 35.5 | 35.6 | 35.6 | 35.7 | 35.5 | </details> #### Offline: NVIDIA A30, NVIDIA TensorRT with FP16, Dataset: traffic Our results were obtained using the following configuration: | Parameter Name | Parameter Value | |:-----------------------------|:-----------------------------| | GPU |NVIDIA A30 | | Backend |NVIDIA TensorRT | | Precision |FP16 | | Model format |NVIDIA TensorRT | | Max batch size |1024 | | Number of model instances |2| | Export Precision | FP32 | | NVIDIA TensorRT Capture CUDA Graph | Disabled | | Dataset | traffic | | Device | gpu | | Request Count | 500 | <table> <tbody> <tr> <td colspan="2" align="center"><img src="./reports/nvidia_a30_experiment_18_triton_performance_offline_18/plots/throughput_vs_latency.png"></td> </tr> </tbody> </table> <details> <summary>Results Table</summary> | Batch | Concurrency | Inferences/Second | Client Send (ms) | Network+Server Send/Recv (ms) | Server Queue (ms) | Server Compute Input (ms) | Server Compute Infer (ms) | Server Compute Output (ms) | Client Recv (ms) | p50 latency (ms) | p90 latency (ms) | p95 latency (ms) | p99 latency (ms) | avg latency (ms) | |--------:|--------------:|--------------------:|-------------------:|--------------------------------:|--------------------:|----------------------------:|----------------------------:|-----------------------------:|-------------------:|-------------------:|-------------------:|-------------------:|-------------------:|-------------------:| | 1 | 1 | 605.4 | 0.0 | 0.2 | 0.0 | 0.1 | 1.3 | 0.0 | 0.0 | 1.6 | 1.7 | 1.7 | 1.7 | 1.6 | | 2 | 1 | 840.0 | 0.0 | 0.1 | 0.0 | 0.1 | 2.1 | 0.0 | 0.0 | 2.4 | 2.4 | 2.4 | 2.5 | 2.4 | | 4 | 1 | 1638.0 | 0.0 | 0.1 | 0.0 | 0.1 | 2.2 | 0.0 | 0.0 | 2.4 | 2.5 | 2.5 | 2.6 | 2.4 | | 8 | 1 | 2876.0 | 0.0 | 0.1 | 0.0 | 0.1 | 2.5 | 0.0 | 0.0 | 2.8 | 2.9 | 2.9 | 2.9 | 2.8 | | 16 | 1 | 5168.0 | 0.0 | 0.1 | 0.0 | 0.1 | 2.8 | 0.0 | 0.0 | 3.1 | 3.3 | 3.3 | 3.4 | 3.1 | | 32 | 1 | 8576.0 | 0.0 | 0.1 | 0.0 | 0.1 | 3.3 | 0.0 | 0.0 | 3.7 | 3.9 | 4.0 | 4.1 | 3.7 | | 64 | 1 | 14592.0 | 0.0 | 0.1 | 0.0 | 0.1 | 4.0 | 0.0 | 0.0 | 4.3 | 4.5 | 4.5 | 4.7 | 4.4 | | 128 | 1 | 19520.0 | 0.0 | 0.1 | 0.0 | 0.1 | 6.2 | 0.0 | 0.0 | 6.5 | 6.6 | 7.9 | 8.3 | 6.5 | | 256 | 1 | 24832.0 | 0.0 | 0.2 | 0.0 | 0.2 | 9.8 | 0.0 | 0.0 | 10.2 | 10.4 | 10.9 | 11.1 | 10.3 | | 512 | 1 | 27235.7 | 0.1 | 0.4 | 0.1 | 1.1 | 17.0 | 0.1 | 0.0 | 18.8 | 18.8 | 18.8 | 18.9 | 18.8 | | 1024 | 1 | 28725.7 | 0.1 | 0.4 | 0.1 | 2.0 | 32.9 | 0.2 | 0.0 | 35.6 | 35.7 | 35.7 | 35.8 | 35.6 | </details> #### Offline: NVIDIA A30, PyTorch with FP16, Dataset: electricity Our results were obtained using the following configuration: | Parameter Name | Parameter Value | |:-----------------------------|:-----------------------------| | GPU |NVIDIA A30 | | Backend |PyTorch | | Precision |FP16 | | Model format |TorchScript Trace | | Max batch size |1024 | | Number of model instances |2| | Export Precision | FP32 | | Dataset | electricity | | Device | gpu | | Request Count | 500 | <table> <tbody> <tr> <td colspan="2" align="center"><img src="./reports/nvidia_a30_experiment_27_triton_performance_offline_27/plots/throughput_vs_latency.png"></td> </tr> </tbody> </table> <details> <summary>Results Table</summary> | Batch | Concurrency | Inferences/Second | Client Send (ms) | Network+Server Send/Recv (ms) | Server Queue (ms) | Server Compute Input (ms) | Server Compute Infer (ms) | Server Compute Output (ms) | Client Recv (ms) | p50 latency (ms) | p90 latency (ms) | p95 latency (ms) | p99 latency (ms) | avg latency (ms) | |--------:|--------------:|--------------------:|-------------------:|--------------------------------:|--------------------:|----------------------------:|----------------------------:|-----------------------------:|-------------------:|-------------------:|-------------------:|-------------------:|-------------------:|-------------------:| | 1 | 1 | 126.5 | 0.1 | 0.4 | 0.1 | 0.1 | 7.2 | 0.0 | 0.0 | 7.8 | 8.0 | 8.8 | 9.5 | 7.9 | | 2 | 1 | 234.8 | 0.1 | 0.4 | 0.1 | 0.1 | 7.8 | 0.0 | 0.0 | 8.3 | 9.9 | 10.1 | 10.3 | 8.5 | | 4 | 1 | 431.1 | 0.1 | 0.4 | 0.1 | 0.1 | 8.5 | 0.0 | 0.0 | 8.6 | 10.3 | 10.4 | 10.5 | 9.2 | | 8 | 1 | 860.8 | 0.1 | 0.4 | 0.1 | 0.2 | 8.5 | 0.0 | 0.0 | 8.9 | 10.5 | 10.7 | 10.8 | 9.3 | | 16 | 1 | 1747.2 | 0.1 | 0.5 | 0.1 | 0.2 | 8.3 | 0.0 | 0.0 | 8.8 | 10.5 | 10.6 | 10.7 | 9.1 | | 32 | 1 | 3205.8 | 0.1 | 0.4 | 0.1 | 0.2 | 9.1 | 0.0 | 0.0 | 9.8 | 11.2 | 11.3 | 11.4 | 10.0 | | 64 | 1 | 6249.6 | 0.1 | 0.4 | 0.1 | 0.3 | 8.9 | 0.4 | 0.0 | 9.7 | 11.5 | 11.5 | 11.6 | 10.2 | | 128 | 1 | 9216.0 | 0.1 | 0.3 | 0.1 | 0.5 | 8.9 | 3.9 | 0.0 | 13.9 | 14.1 | 14.2 | 14.4 | 13.9 | | 256 | 1 | 11369.7 | 0.1 | 0.3 | 0.1 | 0.9 | 5.3 | 15.8 | 0.0 | 22.5 | 22.7 | 22.7 | 23.0 | 22.5 | | 512 | 1 | 12383.8 | 0.1 | 0.3 | 0.1 | 1.6 | 5.4 | 33.8 | 0.0 | 41.3 | 41.5 | 41.6 | 41.7 | 41.3 | | 1024 | 1 | 12849.9 | 0.1 | 0.4 | 0.1 | 3.2 | 5.6 | 70.2 | 0.0 | 79.6 | 80.0 | 80.1 | 80.3 | 79.6 | </details> #### Offline: NVIDIA A30, PyTorch with FP16, Dataset: traffic Our results were obtained using the following configuration: | Parameter Name | Parameter Value | |:-----------------------------|:-----------------------------| | GPU |NVIDIA A30 | | Backend |PyTorch | | Precision |FP16 | | Model format |TorchScript Trace | | Max batch size |1024 | | Number of model instances |2| | Export Precision | FP32 | | Dataset | traffic | | Device | gpu | | Request Count | 500 | <table> <tbody> <tr> <td colspan="2" align="center"><img src="./reports/nvidia_a30_experiment_28_triton_performance_offline_28/plots/throughput_vs_latency.png"></td> </tr> </tbody> </table> <details> <summary>Results Table</summary> | Batch | Concurrency | Inferences/Second | Client Send (ms) | Network+Server Send/Recv (ms) | Server Queue (ms) | Server Compute Input (ms) | Server Compute Infer (ms) | Server Compute Output (ms) | Client Recv (ms) | p50 latency (ms) | p90 latency (ms) | p95 latency (ms) | p99 latency (ms) | avg latency (ms) | |--------:|--------------:|--------------------:|-------------------:|--------------------------------:|--------------------:|----------------------------:|----------------------------:|-----------------------------:|-------------------:|-------------------:|-------------------:|-------------------:|-------------------:|-------------------:| | 1 | 1 | 189.0 | 0.1 | 0.3 | 0.0 | 0.1 | 4.8 | 0.0 | 0.0 | 4.6 | 7.4 | 7.4 | 8.5 | 5.3 | | 2 | 1 | 252.9 | 0.1 | 0.4 | 0.1 | 0.1 | 7.2 | 0.0 | 0.0 | 7.9 | 8.0 | 8.0 | 8.1 | 7.9 | | 4 | 1 | 500.0 | 0.1 | 0.4 | 0.1 | 0.1 | 7.3 | 0.0 | 0.0 | 8.0 | 8.0 | 8.0 | 9.2 | 8.0 | | 8 | 1 | 998.0 | 0.1 | 0.3 | 0.1 | 0.1 | 7.4 | 0.0 | 0.0 | 8.0 | 8.0 | 8.1 | 8.2 | 8.0 | | 16 | 1 | 1996.0 | 0.1 | 0.3 | 0.1 | 0.1 | 7.4 | 0.0 | 0.0 | 8.0 | 8.1 | 8.1 | 9.1 | 8.0 | | 32 | 1 | 3750.4 | 0.1 | 0.4 | 0.1 | 0.1 | 7.8 | 0.0 | 0.0 | 8.5 | 8.6 | 8.7 | 10.3 | 8.5 | | 64 | 1 | 7179.4 | 0.1 | 0.4 | 0.1 | 0.2 | 7.7 | 0.4 | 0.0 | 8.9 | 9.0 | 9.1 | 9.4 | 8.9 | | 128 | 1 | 9946.0 | 0.1 | 0.3 | 0.1 | 0.3 | 7.3 | 4.8 | 0.0 | 12.8 | 13.3 | 13.6 | 13.7 | 12.8 | | 256 | 1 | 11821.5 | 0.0 | 0.2 | 0.0 | 0.6 | 5.0 | 15.8 | 0.0 | 21.6 | 21.8 | 21.8 | 21.8 | 21.6 | | 512 | 1 | 12825.0 | 0.0 | 0.2 | 0.0 | 0.8 | 5.0 | 33.8 | 0.0 | 40.0 | 40.3 | 40.5 | 40.6 | 39.8 | | 1024 | 1 | 13284.7 | 0.0 | 0.2 | 0.0 | 1.8 | 5.3 | 69.7 | 0.0 | 77.3 | 77.7 | 77.8 | 77.9 | 77.1 | </details> #### Offline: NVIDIA DGX-1 (1x V100 32GB), NVIDIA TensorRT with FP16, Dataset: electricity Our results were obtained using the following configuration: | Parameter Name | Parameter Value | |:-----------------------------|:-----------------------------| | GPU |NVIDIA DGX-1 (1x V100 32GB) | | Backend |NVIDIA TensorRT | | Precision |FP16 | | Model format |NVIDIA TensorRT | | Max batch size |1024 | | Number of model instances |2| | Export Precision | FP32 | | NVIDIA TensorRT Capture CUDA Graph | Disabled | | Dataset | electricity | | Device | gpu | | Request Count | 500 | <table> <tbody> <tr> <td colspan="2" align="center"><img src="./reports/nvidia_dgx-1_(1x_v100_32gb)_experiment_17_triton_performance_offline_17/plots/throughput_vs_latency.png"></td> </tr> </tbody> </table> <details> <summary>Results Table</summary> | Batch | Concurrency | Inferences/Second | Client Send (ms) | Network+Server Send/Recv (ms) | Server Queue (ms) | Server Compute Input (ms) | Server Compute Infer (ms) | Server Compute Output (ms) | Client Recv (ms) | p50 latency (ms) | p90 latency (ms) | p95 latency (ms) | p99 latency (ms) | avg latency (ms) | |--------:|--------------:|--------------------:|-------------------:|--------------------------------:|--------------------:|----------------------------:|----------------------------:|-----------------------------:|-------------------:|-------------------:|-------------------:|-------------------:|-------------------:|-------------------:| | 1 | 1 | 416.5 | 0.1 | 0.2 | 0.1 | 0.1 | 1.8 | 0.0 | 0.0 | 2.4 | 2.5 | 2.5 | 2.6 | 2.4 | | 2 | 1 | 770.6 | 0.1 | 0.3 | 0.1 | 0.2 | 1.9 | 0.0 | 0.0 | 2.6 | 2.6 | 2.7 | 2.7 | 2.6 | | 4 | 1 | 1427.3 | 0.1 | 0.2 | 0.1 | 0.2 | 2.2 | 0.0 | 0.0 | 2.8 | 2.9 | 2.9 | 3.0 | 2.8 | | 8 | 1 | 2604.0 | 0.1 | 0.3 | 0.1 | 0.2 | 2.4 | 0.0 | 0.0 | 3.1 | 3.2 | 3.2 | 3.3 | 3.1 | | 16 | 1 | 4480.0 | 0.1 | 0.3 | 0.1 | 0.2 | 2.9 | 0.0 | 0.0 | 3.6 | 3.7 | 3.7 | 3.8 | 3.6 | | 32 | 1 | 7274.7 | 0.1 | 0.2 | 0.1 | 0.2 | 3.9 | 0.0 | 0.0 | 4.4 | 4.5 | 4.5 | 4.6 | 4.4 | | 64 | 1 | 10922.7 | 0.1 | 0.2 | 0.1 | 0.2 | 5.3 | 0.0 | 0.0 | 5.8 | 6.0 | 6.0 | 6.1 | 5.8 | | 128 | 1 | 13744.5 | 0.1 | 0.2 | 0.1 | 0.2 | 8.7 | 0.0 | 0.0 | 9.3 | 9.4 | 9.4 | 9.6 | 9.3 | | 256 | 1 | 17341.8 | 0.1 | 0.2 | 0.1 | 0.3 | 14.0 | 0.0 | 0.0 | 14.7 | 14.9 | 14.9 | 15.1 | 14.7 | | 512 | 1 | 20439.0 | 0.1 | 0.2 | 0.1 | 0.5 | 24.1 | 0.0 | 0.0 | 25.0 | 25.1 | 25.2 | 25.6 | 25.0 | | 1024 | 1 | 23410.2 | 0.1 | 0.3 | 0.1 | 0.7 | 42.5 | 0.0 | 0.0 | 43.6 | 43.8 | 43.9 | 44.6 | 43.7 | </details> #### Offline: NVIDIA DGX-1 (1x V100 32GB), NVIDIA TensorRT with FP16, Dataset: traffic Our results were obtained using the following configuration: | Parameter Name | Parameter Value | |:-----------------------------|:-----------------------------| | GPU |NVIDIA DGX-1 (1x V100 32GB) | | Backend |NVIDIA TensorRT | | Precision |FP16 | | Model format |NVIDIA TensorRT | | Max batch size |1024 | | Number of model instances |2| | Export Precision | FP32 | | NVIDIA TensorRT Capture CUDA Graph | Disabled | | Dataset | traffic | | Device | gpu | | Request Count | 500 | <table> <tbody> <tr> <td colspan="2" align="center"><img src="./reports/nvidia_dgx-1_(1x_v100_32gb)_experiment_18_triton_performance_offline_18/plots/throughput_vs_latency.png"></td> </tr> </tbody> </table> <details> <summary>Results Table</summary> | Batch | Concurrency | Inferences/Second | Client Send (ms) | Network+Server Send/Recv (ms) | Server Queue (ms) | Server Compute Input (ms) | Server Compute Infer (ms) | Server Compute Output (ms) | Client Recv (ms) | p50 latency (ms) | p90 latency (ms) | p95 latency (ms) | p99 latency (ms) | avg latency (ms) | |--------:|--------------:|--------------------:|-------------------:|--------------------------------:|--------------------:|----------------------------:|----------------------------:|-----------------------------:|-------------------:|-------------------:|-------------------:|-------------------:|-------------------:|-------------------:| | 1 | 1 | 406.0 | 0.1 | 0.2 | 0.1 | 0.2 | 1.8 | 0.0 | 0.0 | 2.4 | 2.5 | 2.5 | 2.6 | 2.5 | | 2 | 1 | 775.0 | 0.1 | 0.2 | 0.1 | 0.2 | 2.0 | 0.0 | 0.0 | 2.6 | 2.7 | 2.7 | 2.8 | 2.6 | | 4 | 1 | 1431.3 | 0.1 | 0.2 | 0.1 | 0.2 | 2.2 | 0.0 | 0.0 | 2.8 | 3.0 | 3.0 | 3.2 | 2.8 | | 8 | 1 | 2644.0 | 0.1 | 0.2 | 0.1 | 0.1 | 2.5 | 0.0 | 0.0 | 3.0 | 3.1 | 3.1 | 3.1 | 3.0 | | 16 | 1 | 4824.0 | 0.1 | 0.2 | 0.1 | 0.2 | 2.7 | 0.0 | 0.0 | 3.3 | 3.4 | 3.4 | 3.5 | 3.3 | | 32 | 1 | 7637.3 | 0.1 | 0.2 | 0.1 | 0.2 | 3.6 | 0.0 | 0.0 | 4.2 | 4.3 | 4.3 | 4.4 | 4.2 | | 64 | 1 | 10919.0 | 0.1 | 0.3 | 0.1 | 0.2 | 5.2 | 0.0 | 0.0 | 5.8 | 5.9 | 6.0 | 6.0 | 5.8 | | 128 | 1 | 13488.5 | 0.1 | 0.2 | 0.1 | 0.2 | 8.8 | 0.0 | 0.0 | 9.4 | 9.7 | 9.8 | 10.0 | 9.5 | | 256 | 1 | 17216.0 | 0.1 | 0.2 | 0.1 | 0.3 | 14.2 | 0.0 | 0.0 | 14.8 | 15.0 | 15.1 | 15.2 | 14.8 | | 512 | 1 | 20596.6 | 0.1 | 0.3 | 0.1 | 0.5 | 23.9 | 0.0 | 0.0 | 24.8 | 25.0 | 25.1 | 25.3 | 24.8 | | 1024 | 1 | 23456.8 | 0.1 | 0.2 | 0.1 | 0.7 | 42.6 | 0.0 | 0.0 | 43.7 | 44.3 | 44.4 | 44.9 | 43.6 | </details> #### Offline: NVIDIA DGX-1 (1x V100 32GB), PyTorch with FP16, Dataset: electricity Our results were obtained using the following configuration: | Parameter Name | Parameter Value | |:-----------------------------|:-----------------------------| | GPU |NVIDIA DGX-1 (1x V100 32GB) | | Backend |PyTorch | | Precision |FP16 | | Model format |TorchScript Trace | | Max batch size |1024 | | Number of model instances |2| | Export Precision | FP32 | | Dataset | electricity | | Device | gpu | | Request Count | 500 | <table> <tbody> <tr> <td colspan="2" align="center"><img src="./reports/nvidia_dgx-1_(1x_v100_32gb)_experiment_27_triton_performance_offline_27/plots/throughput_vs_latency.png"></td> </tr> </tbody> </table> <details> <summary>Results Table</summary> | Batch | Concurrency | Inferences/Second | Client Send (ms) | Network+Server Send/Recv (ms) | Server Queue (ms) | Server Compute Input (ms) | Server Compute Infer (ms) | Server Compute Output (ms) | Client Recv (ms) | p50 latency (ms) | p90 latency (ms) | p95 latency (ms) | p99 latency (ms) | avg latency (ms) | |--------:|--------------:|--------------------:|-------------------:|--------------------------------:|--------------------:|----------------------------:|----------------------------:|-----------------------------:|-------------------:|-------------------:|-------------------:|-------------------:|-------------------:|-------------------:| | 1 | 1 | 134.2 | 0.1 | 0.3 | 0.1 | 0.1 | 6.9 | 0.0 | 0.0 | 8.1 | 8.3 | 8.4 | 9.1 | 7.4 | | 2 | 1 | 271.5 | 0.0 | 0.2 | 0.1 | 0.1 | 6.9 | 0.0 | 0.0 | 7.2 | 8.2 | 8.3 | 8.3 | 7.3 | | 4 | 1 | 524.9 | 0.1 | 0.3 | 0.1 | 0.1 | 7.1 | 0.0 | 0.0 | 8.3 | 8.5 | 8.9 | 9.6 | 7.6 | | 8 | 1 | 1044.0 | 0.1 | 0.3 | 0.1 | 0.1 | 7.1 | 0.0 | 0.0 | 8.4 | 8.5 | 8.6 | 9.5 | 7.6 | | 16 | 1 | 2119.5 | 0.1 | 0.3 | 0.1 | 0.1 | 7.0 | 0.0 | 0.0 | 8.2 | 8.4 | 8.5 | 8.8 | 7.5 | | 32 | 1 | 3775.2 | 0.1 | 0.3 | 0.1 | 0.1 | 7.9 | 0.0 | 0.0 | 9.2 | 9.4 | 9.4 | 9.5 | 8.4 | | 64 | 1 | 6424.3 | 0.1 | 0.3 | 0.1 | 0.1 | 7.9 | 1.5 | 0.0 | 9.9 | 10.1 | 10.1 | 10.6 | 9.9 | | 128 | 1 | 8528.0 | 0.1 | 0.2 | 0.1 | 0.2 | 8.0 | 6.4 | 0.0 | 15.1 | 15.2 | 15.3 | 15.4 | 15.0 | | 256 | 1 | 10644.4 | 0.1 | 0.3 | 0.1 | 0.3 | 8.0 | 15.3 | 0.0 | 24.1 | 24.3 | 24.3 | 24.7 | 24.0 | | 512 | 1 | 12213.7 | 0.1 | 0.3 | 0.1 | 0.5 | 7.3 | 33.8 | 0.0 | 41.9 | 42.1 | 42.1 | 42.2 | 41.9 | | 1024 | 1 | 13153.4 | 0.1 | 0.3 | 0.1 | 0.8 | 6.6 | 69.9 | 0.0 | 77.7 | 77.8 | 77.9 | 78.1 | 77.7 | </details> #### Offline: NVIDIA DGX-1 (1x V100 32GB), PyTorch with FP16, Dataset: traffic Our results were obtained using the following configuration: | Parameter Name | Parameter Value | |:-----------------------------|:-----------------------------| | GPU |NVIDIA DGX-1 (1x V100 32GB) | | Backend |PyTorch | | Precision |FP16 | | Model format |TorchScript Trace | | Max batch size |1024 | | Number of model instances |2| | Export Precision | FP32 | | Dataset | traffic | | Device | gpu | | Request Count | 500 | <table> <tbody> <tr> <td colspan="2" align="center"><img src="./reports/nvidia_dgx-1_(1x_v100_32gb)_experiment_28_triton_performance_offline_28/plots/throughput_vs_latency.png"></td> </tr> </tbody> </table> <details> <summary>Results Table</summary> | Batch | Concurrency | Inferences/Second | Client Send (ms) | Network+Server Send/Recv (ms) | Server Queue (ms) | Server Compute Input (ms) | Server Compute Infer (ms) | Server Compute Output (ms) | Client Recv (ms) | p50 latency (ms) | p90 latency (ms) | p95 latency (ms) | p99 latency (ms) | avg latency (ms) | |--------:|--------------:|--------------------:|-------------------:|--------------------------------:|--------------------:|----------------------------:|----------------------------:|-----------------------------:|-------------------:|-------------------:|-------------------:|-------------------:|-------------------:|-------------------:| | 1 | 1 | 158.0 | 0.1 | 0.2 | 0.1 | 0.1 | 5.9 | 0.0 | 0.0 | 6.4 | 6.5 | 6.6 | 6.7 | 6.3 | | 2 | 1 | 312.5 | 0.1 | 0.3 | 0.1 | 0.1 | 5.9 | 0.0 | 0.0 | 6.5 | 6.6 | 6.6 | 6.8 | 6.4 | | 4 | 1 | 608.0 | 0.1 | 0.3 | 0.1 | 0.1 | 6.0 | 0.0 | 0.0 | 6.6 | 6.8 | 6.8 | 7.0 | 6.6 | | 8 | 1 | 1208.0 | 0.1 | 0.2 | 0.1 | 0.1 | 6.1 | 0.0 | 0.0 | 6.7 | 6.8 | 6.9 | 6.9 | 6.6 | | 16 | 1 | 2456.0 | 0.1 | 0.3 | 0.1 | 0.1 | 5.9 | 0.0 | 0.0 | 6.5 | 6.6 | 6.7 | 7.3 | 6.5 | | 32 | 1 | 4352.0 | 0.1 | 0.3 | 0.1 | 0.1 | 6.8 | 0.0 | 0.0 | 7.3 | 7.4 | 7.5 | 8.1 | 7.3 | | 64 | 1 | 6366.9 | 0.1 | 0.3 | 0.1 | 0.1 | 7.2 | 2.3 | 0.0 | 10.0 | 10.1 | 10.1 | 10.2 | 10.0 | | 128 | 1 | 8544.0 | 0.1 | 0.3 | 0.1 | 0.2 | 7.3 | 7.0 | 0.0 | 14.9 | 15.1 | 15.1 | 15.3 | 15.0 | | 256 | 1 | 10687.1 | 0.1 | 0.3 | 0.1 | 0.3 | 7.3 | 15.9 | 0.0 | 23.9 | 24.0 | 24.0 | 24.1 | 23.9 | | 512 | 1 | 12189.3 | 0.1 | 0.3 | 0.1 | 0.5 | 7.2 | 33.9 | 0.0 | 42.0 | 42.1 | 42.1 | 42.2 | 42.0 | | 1024 | 1 | 13153.1 | 0.1 | 0.3 | 0.1 | 0.8 | 7.0 | 69.5 | 0.0 | 77.8 | 77.9 | 77.9 | 78.1 | 77.8 | </details> #### Offline: NVIDIA DGX A100 (1x A100 80GB), NVIDIA TensorRT with FP16, Dataset: electricity Our results were obtained using the following configuration: | Parameter Name | Parameter Value | |:-----------------------------|:-----------------------------| | GPU |NVIDIA DGX A100 (1x A100 80GB) | | Backend |NVIDIA TensorRT | | Precision |FP16 | | Model format |NVIDIA TensorRT | | Max batch size |1024 | | Number of model instances |2| | Export Precision | FP32 | | NVIDIA TensorRT Capture CUDA Graph | Disabled | | Dataset | electricity | | Device | gpu | | Request Count | 500 | <table> <tbody> <tr> <td colspan="2" align="center"><img src="./reports/nvidia_dgx_a100_(1x_a100_80gb)_experiment_17_triton_performance_offline_17/plots/throughput_vs_latency.png"></td> </tr> </tbody> </table> <details> <summary>Results Table</summary> | Batch | Concurrency | Inferences/Second | Client Send (ms) | Network+Server Send/Recv (ms) | Server Queue (ms) | Server Compute Input (ms) | Server Compute Infer (ms) | Server Compute Output (ms) | Client Recv (ms) | p50 latency (ms) | p90 latency (ms) | p95 latency (ms) | p99 latency (ms) | avg latency (ms) | |--------:|--------------:|--------------------:|-------------------:|--------------------------------:|--------------------:|----------------------------:|----------------------------:|-----------------------------:|-------------------:|-------------------:|-------------------:|-------------------:|-------------------:|-------------------:| | 1 | 1 | 663.0 | 0.0 | 0.1 | 0.0 | 0.1 | 1.3 | 0.0 | 0.0 | 1.4 | 1.6 | 1.6 | 4.7 | 1.5 | | 2 | 1 | 879.0 | 0.0 | 0.1 | 0.0 | 0.1 | 2.1 | 0.0 | 0.0 | 2.3 | 2.4 | 2.4 | 2.4 | 2.3 | | 4 | 1 | 1638.0 | 0.0 | 0.1 | 0.0 | 0.1 | 2.2 | 0.0 | 0.0 | 2.4 | 2.5 | 2.5 | 2.5 | 2.4 | | 8 | 1 | 3080.0 | 0.0 | 0.1 | 0.0 | 0.1 | 2.4 | 0.0 | 0.0 | 2.6 | 2.6 | 2.7 | 2.7 | 2.6 | | 16 | 1 | 5808.0 | 0.0 | 0.1 | 0.0 | 0.1 | 2.5 | 0.0 | 0.0 | 2.7 | 2.8 | 2.8 | 2.9 | 2.8 | | 32 | 1 | 10688.0 | 0.0 | 0.1 | 0.0 | 0.1 | 2.7 | 0.0 | 0.0 | 3.0 | 3.1 | 3.1 | 3.1 | 3.0 | | 64 | 1 | 17664.0 | 0.0 | 0.1 | 0.0 | 0.1 | 3.4 | 0.0 | 0.0 | 3.6 | 3.8 | 3.9 | 3.9 | 3.6 | | 128 | 1 | 24362.7 | 0.0 | 0.1 | 0.0 | 0.2 | 4.9 | 0.0 | 0.0 | 5.2 | 5.5 | 5.5 | 5.6 | 5.2 | | 256 | 1 | 35136.0 | 0.0 | 0.1 | 0.0 | 0.2 | 6.9 | 0.0 | 0.0 | 7.3 | 7.5 | 7.5 | 7.7 | 7.3 | | 512 | 1 | 49493.3 | 0.0 | 0.1 | 0.0 | 0.2 | 9.9 | 0.0 | 0.0 | 10.2 | 10.4 | 10.5 | 12.9 | 10.3 | | 1024 | 1 | 54061.8 | 0.0 | 0.1 | 0.0 | 0.5 | 18.2 | 0.1 | 0.0 | 18.8 | 18.9 | 19.0 | 22.3 | 18.9 | </details> #### Offline: NVIDIA DGX A100 (1x A100 80GB), NVIDIA TensorRT with FP16, Dataset: traffic Our results were obtained using the following configuration: | Parameter Name | Parameter Value | |:-----------------------------|:-----------------------------| | GPU |NVIDIA DGX A100 (1x A100 80GB) | | Backend |NVIDIA TensorRT | | Precision |FP16 | | Model format |NVIDIA TensorRT | | Max batch size |1024 | | Number of model instances |2| | Export Precision | FP32 | | NVIDIA TensorRT Capture CUDA Graph | Disabled | | Dataset | traffic | | Device | gpu | | Request Count | 500 | <table> <tbody> <tr> <td colspan="2" align="center"><img src="./reports/nvidia_dgx_a100_(1x_a100_80gb)_experiment_18_triton_performance_offline_18/plots/throughput_vs_latency.png"></td> </tr> </tbody> </table> <details> <summary>Results Table</summary> | Batch | Concurrency | Inferences/Second | Client Send (ms) | Network+Server Send/Recv (ms) | Server Queue (ms) | Server Compute Input (ms) | Server Compute Infer (ms) | Server Compute Output (ms) | Client Recv (ms) | p50 latency (ms) | p90 latency (ms) | p95 latency (ms) | p99 latency (ms) | avg latency (ms) | |--------:|--------------:|--------------------:|-------------------:|--------------------------------:|--------------------:|----------------------------:|----------------------------:|-----------------------------:|-------------------:|-------------------:|-------------------:|-------------------:|-------------------:|-------------------:| | 1 | 1 | 716.0 | 0.0 | 0.1 | 0.0 | 0.1 | 1.2 | 0.0 | 0.0 | 1.4 | 1.4 | 1.4 | 2.1 | 1.4 | | 2 | 1 | 878.0 | 0.0 | 0.1 | 0.0 | 0.1 | 2.1 | 0.0 | 0.0 | 2.3 | 2.4 | 2.4 | 2.4 | 2.3 | | 4 | 1 | 1653.2 | 0.0 | 0.1 | 0.0 | 0.1 | 2.2 | 0.0 | 0.0 | 2.4 | 2.5 | 2.5 | 2.5 | 2.4 | | 8 | 1 | 3192.0 | 0.0 | 0.1 | 0.0 | 0.1 | 2.3 | 0.0 | 0.0 | 2.5 | 2.5 | 2.6 | 2.6 | 2.5 | | 16 | 1 | 5920.0 | 0.0 | 0.1 | 0.0 | 0.1 | 2.5 | 0.0 | 0.0 | 2.7 | 2.8 | 2.8 | 2.8 | 2.7 | | 32 | 1 | 10624.0 | 0.0 | 0.1 | 0.0 | 0.1 | 2.8 | 0.0 | 0.0 | 3.0 | 3.1 | 3.1 | 3.1 | 3.0 | | 64 | 1 | 18358.8 | 0.0 | 0.1 | 0.0 | 0.1 | 3.2 | 0.0 | 0.0 | 3.5 | 3.5 | 3.6 | 3.6 | 3.5 | | 128 | 1 | 24738.4 | 0.0 | 0.1 | 0.0 | 0.2 | 4.8 | 0.0 | 0.0 | 5.2 | 5.3 | 5.3 | 5.4 | 5.2 | | 256 | 1 | 35776.0 | 0.0 | 0.1 | 0.0 | 0.2 | 6.8 | 0.0 | 0.0 | 7.1 | 7.3 | 7.4 | 7.5 | 7.1 | | 512 | 1 | 49834.7 | 0.0 | 0.1 | 0.0 | 0.2 | 9.9 | 0.0 | 0.0 | 10.2 | 10.3 | 10.3 | 11.3 | 10.3 | | 1024 | 1 | 53350.4 | 0.0 | 0.1 | 0.0 | 0.4 | 18.6 | 0.0 | 0.0 | 19.1 | 19.2 | 19.3 | 22.4 | 19.2 | </details> #### Offline: NVIDIA DGX A100 (1x A100 80GB), PyTorch with FP16, Dataset: electricity Our results were obtained using the following configuration: | Parameter Name | Parameter Value | |:-----------------------------|:-----------------------------| | GPU |NVIDIA DGX A100 (1x A100 80GB) | | Backend |PyTorch | | Precision |FP16 | | Model format |TorchScript Trace | | Max batch size |1024 | | Number of model instances |2| | Export Precision | FP32 | | Dataset | electricity | | Device | gpu | | Request Count | 500 | <table> <tbody> <tr> <td colspan="2" align="center"><img src="./reports/nvidia_dgx_a100_(1x_a100_80gb)_experiment_27_triton_performance_offline_27/plots/throughput_vs_latency.png"></td> </tr> </tbody> </table> <details> <summary>Results Table</summary> | Batch | Concurrency | Inferences/Second | Client Send (ms) | Network+Server Send/Recv (ms) | Server Queue (ms) | Server Compute Input (ms) | Server Compute Infer (ms) | Server Compute Output (ms) | Client Recv (ms) | p50 latency (ms) | p90 latency (ms) | p95 latency (ms) | p99 latency (ms) | avg latency (ms) | |--------:|--------------:|--------------------:|-------------------:|--------------------------------:|--------------------:|----------------------------:|----------------------------:|-----------------------------:|-------------------:|-------------------:|-------------------:|-------------------:|-------------------:|-------------------:| | 1 | 1 | 205.0 | 0.0 | 0.1 | 0.0 | 0.1 | 4.6 | 0.0 | 0.0 | 4.8 | 4.9 | 4.9 | 5.3 | 4.9 | | 2 | 1 | 396.0 | 0.0 | 0.1 | 0.0 | 0.1 | 4.8 | 0.0 | 0.0 | 5.0 | 5.2 | 5.4 | 5.5 | 5.0 | | 4 | 1 | 788.0 | 0.0 | 0.1 | 0.0 | 0.1 | 4.8 | 0.0 | 0.0 | 5.0 | 5.1 | 5.3 | 5.5 | 5.1 | | 8 | 1 | 1544.0 | 0.0 | 0.1 | 0.0 | 0.1 | 4.9 | 0.0 | 0.0 | 5.1 | 5.4 | 5.5 | 5.6 | 5.2 | | 16 | 1 | 3081.6 | 0.0 | 0.1 | 0.0 | 0.1 | 4.9 | 0.0 | 0.0 | 5.1 | 5.4 | 5.5 | 5.6 | 5.2 | | 32 | 1 | 5802.7 | 0.0 | 0.1 | 0.0 | 0.1 | 5.2 | 0.0 | 0.0 | 5.5 | 5.5 | 5.8 | 5.9 | 5.5 | | 64 | 1 | 10624.0 | 0.0 | 0.1 | 0.0 | 0.1 | 5.3 | 0.5 | 0.0 | 6.0 | 6.1 | 6.2 | 6.4 | 6.0 | | 128 | 1 | 15203.4 | 0.0 | 0.1 | 0.0 | 0.2 | 5.3 | 2.8 | 0.0 | 8.4 | 8.6 | 8.7 | 8.9 | 8.4 | | 256 | 1 | 19821.7 | 0.0 | 0.1 | 0.0 | 0.3 | 5.3 | 7.2 | 0.0 | 13.0 | 13.1 | 13.3 | 13.4 | 12.9 | | 512 | 1 | 23123.4 | 0.0 | 0.1 | 0.0 | 0.4 | 5.3 | 16.2 | 0.0 | 22.2 | 22.3 | 22.4 | 22.4 | 22.1 | | 1024 | 1 | 25159.9 | 0.0 | 0.1 | 0.0 | 0.9 | 5.7 | 33.9 | 0.0 | 40.7 | 40.8 | 40.9 | 40.9 | 40.6 | </details> #### Offline: NVIDIA DGX A100 (1x A100 80GB), PyTorch with FP16, Dataset: traffic Our results were obtained using the following configuration: | Parameter Name | Parameter Value | |:-----------------------------|:-----------------------------| | GPU |NVIDIA DGX A100 (1x A100 80GB) | | Backend |PyTorch | | Precision |FP16 | | Model format |TorchScript Trace | | Max batch size |1024 | | Number of model instances |2| | Export Precision | FP32 | | Dataset | traffic | | Device | gpu | | Request Count | 500 | <table> <tbody> <tr> <td colspan="2" align="center"><img src="./reports/nvidia_dgx_a100_(1x_a100_80gb)_experiment_28_triton_performance_offline_28/plots/throughput_vs_latency.png"></td> </tr> </tbody> </table> <details> <summary>Results Table</summary> | Batch | Concurrency | Inferences/Second | Client Send (ms) | Network+Server Send/Recv (ms) | Server Queue (ms) | Server Compute Input (ms) | Server Compute Infer (ms) | Server Compute Output (ms) | Client Recv (ms) | p50 latency (ms) | p90 latency (ms) | p95 latency (ms) | p99 latency (ms) | avg latency (ms) | |--------:|--------------:|--------------------:|-------------------:|--------------------------------:|--------------------:|----------------------------:|----------------------------:|-----------------------------:|-------------------:|-------------------:|-------------------:|-------------------:|-------------------:|-------------------:| | 1 | 1 | 200.3 | 0.0 | 0.1 | 0.0 | 0.1 | 4.7 | 0.0 | 0.0 | 5.0 | 5.1 | 5.3 | 5.4 | 5.0 | | 2 | 1 | 393.3 | 0.0 | 0.1 | 0.0 | 0.1 | 4.8 | 0.0 | 0.0 | 5.1 | 5.1 | 5.4 | 5.5 | 5.1 | | 4 | 1 | 774.7 | 0.0 | 0.1 | 0.0 | 0.1 | 4.9 | 0.0 | 0.0 | 5.1 | 5.2 | 5.5 | 5.8 | 5.2 | | 8 | 1 | 1525.3 | 0.0 | 0.1 | 0.0 | 0.1 | 5.0 | 0.0 | 0.0 | 5.2 | 5.5 | 5.6 | 5.7 | 5.2 | | 16 | 1 | 3028.3 | 0.0 | 0.1 | 0.0 | 0.1 | 5.0 | 0.0 | 0.0 | 5.2 | 5.6 | 5.7 | 5.7 | 5.3 | | 32 | 1 | 5696.0 | 0.0 | 0.1 | 0.0 | 0.1 | 5.3 | 0.0 | 0.0 | 5.6 | 5.7 | 5.9 | 6.0 | 5.6 | | 64 | 1 | 10645.3 | 0.0 | 0.1 | 0.0 | 0.1 | 5.4 | 0.3 | 0.0 | 6.0 | 6.2 | 6.2 | 6.3 | 6.0 | | 128 | 1 | 15229.0 | 0.0 | 0.2 | 0.0 | 0.2 | 5.4 | 2.6 | 0.0 | 8.4 | 8.6 | 8.7 | 8.8 | 8.4 | | 256 | 1 | 19965.1 | 0.0 | 0.1 | 0.0 | 0.3 | 5.4 | 7.0 | 0.0 | 12.8 | 13.2 | 13.3 | 13.3 | 12.8 | | 512 | 1 | 23319.3 | 0.0 | 0.1 | 0.0 | 0.5 | 5.4 | 15.9 | 0.0 | 21.9 | 22.1 | 22.2 | 22.2 | 21.9 | | 1024 | 1 | 25452.5 | 0.0 | 0.1 | 0.0 | 0.9 | 5.8 | 33.3 | 0.0 | 40.2 | 40.4 | 40.5 | 40.6 | 40.2 | </details> #### Offline: NVIDIA T4, NVIDIA TensorRT with FP16, Dataset: electricity Our results were obtained using the following configuration: | Parameter Name | Parameter Value | |:-----------------------------|:-----------------------------| | GPU |NVIDIA T4 | | Backend |NVIDIA TensorRT | | Precision |FP16 | | Model format |NVIDIA TensorRT | | Max batch size |1024 | | Number of model instances |2| | Export Precision | FP32 | | NVIDIA TensorRT Capture CUDA Graph | Disabled | | Dataset | electricity | | Device | gpu | | Request Count | 500 | <table> <tbody> <tr> <td colspan="2" align="center"><img src="./reports/nvidia_t4_experiment_17_triton_performance_offline_17/plots/throughput_vs_latency.png"></td> </tr> </tbody> </table> <details> <summary>Results Table</summary> | Batch | Concurrency | Inferences/Second | Client Send (ms) | Network+Server Send/Recv (ms) | Server Queue (ms) | Server Compute Input (ms) | Server Compute Infer (ms) | Server Compute Output (ms) | Client Recv (ms) | p50 latency (ms) | p90 latency (ms) | p95 latency (ms) | p99 latency (ms) | avg latency (ms) | |--------:|--------------:|--------------------:|-------------------:|--------------------------------:|--------------------:|----------------------------:|----------------------------:|-----------------------------:|-------------------:|-------------------:|-------------------:|-------------------:|-------------------:|-------------------:| | 1 | 1 | 415.0 | 0.1 | 0.4 | 0.1 | 0.2 | 1.6 | 0.0 | 0.0 | 2.4 | 2.5 | 2.5 | 2.5 | 2.4 | | 2 | 1 | 781.6 | 0.1 | 0.4 | 0.1 | 0.2 | 1.7 | 0.0 | 0.0 | 2.5 | 2.6 | 2.6 | 2.6 | 2.5 | | 4 | 1 | 1617.2 | 0.1 | 0.3 | 0.1 | 0.2 | 1.8 | 0.0 | 0.0 | 2.5 | 2.5 | 2.5 | 2.6 | 2.5 | | 8 | 1 | 2998.5 | 0.1 | 0.3 | 0.1 | 0.2 | 2.0 | 0.0 | 0.0 | 2.7 | 2.7 | 2.7 | 2.7 | 2.6 | | 16 | 1 | 4504.0 | 0.1 | 0.5 | 0.1 | 0.2 | 2.7 | 0.0 | 0.0 | 3.5 | 3.6 | 3.6 | 3.6 | 3.5 | | 32 | 1 | 6483.2 | 0.1 | 0.5 | 0.1 | 0.2 | 4.0 | 0.0 | 0.0 | 4.9 | 5.0 | 5.0 | 5.0 | 4.9 | | 64 | 1 | 9197.7 | 0.1 | 0.5 | 0.0 | 0.2 | 6.1 | 0.0 | 0.0 | 6.9 | 7.0 | 7.0 | 7.0 | 6.9 | | 128 | 1 | 11136.0 | 0.0 | 0.3 | 0.1 | 0.2 | 10.8 | 0.0 | 0.0 | 11.5 | 11.6 | 11.6 | 11.6 | 11.5 | | 256 | 1 | 12682.5 | 0.1 | 0.5 | 0.1 | 0.2 | 19.2 | 0.0 | 0.0 | 20.1 | 20.2 | 20.3 | 20.3 | 20.1 | | 512 | 1 | 12628.1 | 0.1 | 0.5 | 0.1 | 0.4 | 39.5 | 0.0 | 0.0 | 40.5 | 40.7 | 40.7 | 40.8 | 40.5 | | 1024 | 1 | 13054.4 | 0.1 | 0.5 | 0.1 | 0.6 | 77.1 | 0.0 | 0.0 | 78.4 | 78.9 | 79.0 | 79.2 | 78.4 | </details> #### Offline: NVIDIA T4, NVIDIA TensorRT with FP16, Dataset: traffic Our results were obtained using the following configuration: | Parameter Name | Parameter Value | |:-----------------------------|:-----------------------------| | GPU |NVIDIA T4 | | Backend |NVIDIA TensorRT | | Precision |FP16 | | Model format |NVIDIA TensorRT | | Max batch size |1024 | | Number of model instances |2| | Export Precision | FP32 | | NVIDIA TensorRT Capture CUDA Graph | Disabled | | Dataset | traffic | | Device | gpu | | Request Count | 500 | <table> <tbody> <tr> <td colspan="2" align="center"><img src="./reports/nvidia_t4_experiment_18_triton_performance_offline_18/plots/throughput_vs_latency.png"></td> </tr> </tbody> </table> <details> <summary>Results Table</summary> | Batch | Concurrency | Inferences/Second | Client Send (ms) | Network+Server Send/Recv (ms) | Server Queue (ms) | Server Compute Input (ms) | Server Compute Infer (ms) | Server Compute Output (ms) | Client Recv (ms) | p50 latency (ms) | p90 latency (ms) | p95 latency (ms) | p99 latency (ms) | avg latency (ms) | |--------:|--------------:|--------------------:|-------------------:|--------------------------------:|--------------------:|----------------------------:|----------------------------:|-----------------------------:|-------------------:|-------------------:|-------------------:|-------------------:|-------------------:|-------------------:| | 1 | 1 | 455.5 | 0.1 | 0.3 | 0.0 | 0.1 | 1.6 | 0.0 | 0.0 | 2.2 | 2.3 | 2.3 | 2.3 | 2.2 | | 2 | 1 | 872.0 | 0.1 | 0.3 | 0.1 | 0.1 | 1.7 | 0.0 | 0.0 | 2.3 | 2.4 | 2.4 | 2.4 | 2.3 | | 4 | 1 | 1622.0 | 0.1 | 0.2 | 0.1 | 0.1 | 1.9 | 0.0 | 0.0 | 2.5 | 2.5 | 2.5 | 2.6 | 2.4 | | 8 | 1 | 2882.6 | 0.1 | 0.4 | 0.1 | 0.1 | 2.0 | 0.0 | 0.0 | 2.8 | 2.9 | 2.9 | 2.9 | 2.8 | | 16 | 1 | 4488.0 | 0.1 | 0.5 | 0.1 | 0.1 | 2.8 | 0.0 | 0.0 | 3.6 | 3.6 | 3.6 | 3.6 | 3.5 | | 32 | 1 | 6592.0 | 0.1 | 0.5 | 0.1 | 0.1 | 4.1 | 0.0 | 0.0 | 4.8 | 4.9 | 4.9 | 4.9 | 4.8 | | 64 | 1 | 9341.7 | 0.1 | 0.4 | 0.1 | 0.1 | 6.1 | 0.0 | 0.0 | 6.8 | 6.9 | 6.9 | 7.0 | 6.8 | | 128 | 1 | 10899.5 | 0.1 | 0.5 | 0.1 | 0.1 | 10.9 | 0.0 | 0.0 | 11.7 | 11.8 | 11.8 | 11.8 | 11.7 | | 256 | 1 | 12681.3 | 0.1 | 0.4 | 0.1 | 0.2 | 19.3 | 0.0 | 0.0 | 20.1 | 20.3 | 20.3 | 20.4 | 20.1 | | 512 | 1 | 12651.9 | 0.1 | 0.5 | 0.1 | 0.3 | 39.5 | 0.0 | 0.0 | 40.4 | 40.6 | 40.7 | 40.8 | 40.4 | | 1024 | 1 | 13003.2 | 0.1 | 0.4 | 0.1 | 0.6 | 77.3 | 0.0 | 0.0 | 78.6 | 79.0 | 79.2 | 79.3 | 78.6 | </details> #### Offline: NVIDIA T4, PyTorch with FP16, Dataset: electricity Our results were obtained using the following configuration: | Parameter Name | Parameter Value | |:-----------------------------|:-----------------------------| | GPU |NVIDIA T4 | | Backend |PyTorch | | Precision |FP16 | | Model format |TorchScript Trace | | Max batch size |1024 | | Number of model instances |2| | Export Precision | FP32 | | Dataset | electricity | | Device | gpu | | Request Count | 500 | <table> <tbody> <tr> <td colspan="2" align="center"><img src="./reports/nvidia_t4_experiment_27_triton_performance_offline_27/plots/throughput_vs_latency.png"></td> </tr> </tbody> </table> <details> <summary>Results Table</summary> | Batch | Concurrency | Inferences/Second | Client Send (ms) | Network+Server Send/Recv (ms) | Server Queue (ms) | Server Compute Input (ms) | Server Compute Infer (ms) | Server Compute Output (ms) | Client Recv (ms) | p50 latency (ms) | p90 latency (ms) | p95 latency (ms) | p99 latency (ms) | avg latency (ms) | |--------:|--------------:|--------------------:|-------------------:|--------------------------------:|--------------------:|----------------------------:|----------------------------:|-----------------------------:|-------------------:|-------------------:|-------------------:|-------------------:|-------------------:|-------------------:| | 1 | 1 | 127.8 | 0.1 | 0.6 | 0.2 | 0.1 | 6.8 | 0.0 | 0.0 | 7.7 | 8.6 | 8.9 | 9.4 | 7.8 | | 2 | 1 | 251.0 | 0.1 | 0.6 | 0.1 | 0.1 | 6.9 | 0.0 | 0.0 | 7.8 | 8.8 | 9.2 | 9.6 | 7.9 | | 4 | 1 | 498.9 | 0.1 | 0.6 | 0.2 | 0.1 | 7.0 | 0.0 | 0.0 | 8.0 | 8.5 | 9.1 | 9.3 | 8.0 | | 8 | 1 | 975.8 | 0.1 | 0.6 | 0.2 | 0.1 | 7.1 | 0.0 | 0.0 | 8.1 | 8.7 | 8.8 | 9.4 | 8.2 | | 16 | 1 | 1913.6 | 0.1 | 0.6 | 0.2 | 0.2 | 7.2 | 0.1 | 0.0 | 8.3 | 8.8 | 8.9 | 9.2 | 8.3 | | 32 | 1 | 2820.9 | 0.1 | 0.6 | 0.1 | 0.2 | 7.5 | 2.8 | 0.0 | 11.3 | 11.6 | 11.6 | 11.8 | 11.3 | | 64 | 1 | 3366.1 | 0.1 | 0.6 | 0.1 | 0.2 | 8.1 | 9.9 | 0.0 | 18.9 | 19.3 | 19.4 | 19.7 | 19.0 | | 128 | 1 | 3786.8 | 0.1 | 0.6 | 0.1 | 0.1 | 4.5 | 28.4 | 0.0 | 33.8 | 34.1 | 34.1 | 34.3 | 33.8 | | 256 | 1 | 3948.1 | 0.1 | 0.6 | 0.1 | 0.2 | 4.4 | 59.4 | 0.0 | 64.7 | 65.5 | 65.8 | 66.0 | 64.7 | | 512 | 1 | 4079.3 | 0.1 | 0.6 | 0.1 | 0.4 | 4.5 | 119.7 | 0.0 | 125.2 | 127.1 | 127.6 | 128.3 | 125.3 | | 1024 | 1 | 4095.5 | 0.1 | 0.6 | 0.1 | 0.8 | 4.5 | 243.8 | 0.0 | 250.0 | 251.7 | 252.0 | 252.6 | 249.9 | </details> #### Offline: NVIDIA T4, PyTorch with FP16, Dataset: traffic Our results were obtained using the following configuration: | Parameter Name | Parameter Value | |:-----------------------------|:-----------------------------| | GPU |NVIDIA T4 | | Backend |PyTorch | | Precision |FP16 | | Model format |TorchScript Trace | | Max batch size |1024 | | Number of model instances |2| | Export Precision | FP32 | | Dataset | traffic | | Device | gpu | | Request Count | 500 | <table> <tbody> <tr> <td colspan="2" align="center"><img src="./reports/nvidia_t4_experiment_28_triton_performance_offline_28/plots/throughput_vs_latency.png"></td> </tr> </tbody> </table> <details> <summary>Results Table</summary> | Batch | Concurrency | Inferences/Second | Client Send (ms) | Network+Server Send/Recv (ms) | Server Queue (ms) | Server Compute Input (ms) | Server Compute Infer (ms) | Server Compute Output (ms) | Client Recv (ms) | p50 latency (ms) | p90 latency (ms) | p95 latency (ms) | p99 latency (ms) | avg latency (ms) | |--------:|--------------:|--------------------:|-------------------:|--------------------------------:|--------------------:|----------------------------:|----------------------------:|-----------------------------:|-------------------:|-------------------:|-------------------:|-------------------:|-------------------:|-------------------:| | 1 | 1 | 136.0 | 0.1 | 0.5 | 0.1 | 0.1 | 6.6 | 0.0 | 0.0 | 7.3 | 7.9 | 8.1 | 8.5 | 7.3 | | 2 | 1 | 242.8 | 0.1 | 0.6 | 0.1 | 0.1 | 7.2 | 0.0 | 0.0 | 8.1 | 8.7 | 9.0 | 9.4 | 8.2 | | 4 | 1 | 479.9 | 0.1 | 0.6 | 0.2 | 0.1 | 7.3 | 0.0 | 0.0 | 8.2 | 8.9 | 9.2 | 9.6 | 8.3 | | 8 | 1 | 943.8 | 0.1 | 0.6 | 0.2 | 0.2 | 7.4 | 0.0 | 0.0 | 8.4 | 9.1 | 9.2 | 9.5 | 8.4 | | 16 | 1 | 2239.4 | 0.1 | 0.5 | 0.1 | 0.1 | 4.2 | 2.1 | 0.0 | 7.1 | 7.2 | 7.2 | 7.3 | 7.1 | | 32 | 1 | 2975.5 | 0.1 | 0.5 | 0.1 | 0.1 | 4.5 | 5.5 | 0.0 | 10.7 | 10.9 | 10.9 | 10.9 | 10.7 | | 64 | 1 | 3436.1 | 0.1 | 0.5 | 0.1 | 0.1 | 5.7 | 12.0 | 0.0 | 18.6 | 19.1 | 19.3 | 19.5 | 18.6 | | 128 | 1 | 3786.8 | 0.1 | 0.5 | 0.1 | 0.2 | 5.7 | 27.1 | 0.0 | 33.7 | 34.0 | 34.1 | 34.2 | 33.7 | | 256 | 1 | 3963.6 | 0.1 | 0.6 | 0.1 | 0.3 | 7.0 | 56.4 | 0.0 | 64.5 | 65.2 | 65.4 | 65.8 | 64.5 | | 512 | 1 | 4103.6 | 0.1 | 0.6 | 0.1 | 0.4 | 6.1 | 117.4 | 0.0 | 124.6 | 126.3 | 126.6 | 127.1 | 124.7 | | 1024 | 1 | 4120.2 | 0.1 | 0.4 | 0.1 | 1.0 | 7.1 | 239.7 | 0.0 | 248.3 | 250.3 | 250.9 | 251.8 | 248.3 | </details> ### Online scenario The online scenario assumes the client and server are located on different hosts. The tests uses: - tensors are passed through HTTP from client to server - concurrent requests are send from client to server, the final batch is created on server side #### Online: NVIDIA A30, NVIDIA TensorRT with FP16, Dataset: electricity Our results were obtained using the following configuration: | Parameter Name | Parameter Value | |:-----------------------------|:-----------------------------| | GPU |NVIDIA A30 | | Backend |NVIDIA TensorRT | | Precision |FP16 | | Model format |NVIDIA TensorRT | | Max batch size |1024 | | Number of model instances |2| | Export Precision | FP32 | | NVIDIA TensorRT Capture CUDA Graph | Disabled | | Dataset | electricity | | Device | gpu | | Request Count | 500 | <table> <tbody> <tr> <td colspan="2" align="center"><img src="./reports/nvidia_a30_experiment_17_triton_performance_online_17/plots/latency_vs_concurrency.png"></td> </tr> </tbody> </table> <details> <summary>Results Table</summary> | Batch | Concurrency | Inferences/Second | Client Send (ms) | Network+Server Send/Recv (ms) | Server Queue (ms) | Server Compute Input (ms) | Server Compute Infer (ms) | Server Compute Output (ms) | Client Recv (ms) | p50 latency (ms) | p90 latency (ms) | p95 latency (ms) | p99 latency (ms) | avg latency (ms) | |--------:|--------------:|--------------------:|-------------------:|--------------------------------:|--------------------:|----------------------------:|----------------------------:|-----------------------------:|-------------------:|-------------------:|-------------------:|-------------------:|-------------------:|-------------------:| | 16 | 8 | 15360.0 | 0.1 | 0.3 | 3.6 | 0.1 | 4.0 | 0.0 | 0.0 | 8.2 | 8.3 | 8.4 | 8.7 | 8.2 | | 16 | 16 | 15696.0 | 0.1 | 0.5 | 8.5 | 0.2 | 6.9 | 0.1 | 0.0 | 16.4 | 20.2 | 20.4 | 22.2 | 16.2 | | 16 | 24 | 17072.0 | 0.1 | 0.8 | 10.8 | 0.2 | 10.2 | 0.1 | 0.0 | 22.3 | 30.5 | 31.9 | 33.4 | 22.2 | | 16 | 32 | 16640.0 | 0.1 | 1.0 | 14.5 | 0.3 | 14.4 | 0.1 | 0.0 | 32.0 | 36.1 | 36.6 | 39.2 | 30.3 | | 16 | 40 | 19120.0 | 0.1 | 1.6 | 13.8 | 0.3 | 17.2 | 0.1 | 0.0 | 34.9 | 43.8 | 46.3 | 48.5 | 33.1 | | 16 | 48 | 15984.0 | 0.1 | 1.7 | 16.1 | 0.4 | 27.9 | 0.1 | 0.0 | 49.2 | 52.5 | 53.0 | 53.5 | 46.2 | | 16 | 56 | 16528.0 | 0.1 | 1.9 | 21.7 | 0.4 | 26.3 | 0.0 | 0.0 | 52.6 | 56.2 | 56.4 | 57.0 | 50.4 | | 16 | 64 | 16256.0 | 0.1 | 2.2 | 30.6 | 0.3 | 27.0 | 0.0 | 0.0 | 63.8 | 66.2 | 66.5 | 66.9 | 60.3 | | 16 | 72 | 17696.0 | 0.1 | 2.5 | 34.4 | 0.4 | 25.8 | 0.0 | 0.0 | 65.5 | 68.9 | 69.6 | 70.3 | 63.3 | | 16 | 80 | 16976.0 | 0.1 | 2.1 | 38.8 | 0.4 | 32.0 | 0.1 | 0.0 | 78.7 | 82.1 | 82.6 | 82.9 | 73.4 | | 16 | 88 | 20464.0 | 0.1 | 2.7 | 32.0 | 0.6 | 30.5 | 0.0 | 0.0 | 62.7 | 79.0 | 80.0 | 80.8 | 66.0 | | 16 | 96 | 20064.0 | 0.1 | 2.9 | 39.5 | 0.6 | 31.3 | 0.1 | 0.0 | 75.6 | 79.8 | 80.6 | 81.0 | 74.3 | | 16 | 104 | 20768.0 | 0.1 | 3.9 | 38.1 | 0.7 | 34.1 | 0.1 | 0.0 | 79.3 | 82.7 | 83.3 | 83.7 | 77.0 | | 16 | 112 | 22032.0 | 0.1 | 3.5 | 43.1 | 0.7 | 33.1 | 0.1 | 0.0 | 83.0 | 84.1 | 84.3 | 84.5 | 80.5 | | 16 | 120 | 21584.0 | 0.1 | 3.4 | 49.9 | 0.8 | 33.0 | 0.1 | 0.0 | 92.2 | 93.1 | 93.2 | 94.2 | 87.3 | | 16 | 128 | 23280.0 | 0.1 | 2.4 | 41.9 | 0.7 | 37.3 | 0.1 | 0.0 | 84.4 | 94.2 | 103.3 | 104.8 | 82.5 | | 16 | 136 | 23232.0 | 0.1 | 3.6 | 52.6 | 0.7 | 32.7 | 0.1 | 0.0 | 92.4 | 93.4 | 93.7 | 94.4 | 89.7 | | 16 | 144 | 24224.0 | 0.1 | 3.7 | 50.7 | 0.8 | 34.6 | 0.1 | 0.0 | 92.8 | 95.0 | 96.1 | 102.7 | 90.0 | | 16 | 152 | 23232.0 | 0.1 | 2.7 | 64.5 | 0.7 | 33.4 | 0.1 | 0.0 | 102.5 | 112.5 | 117.3 | 123.3 | 101.6 | | 16 | 160 | 21040.0 | 0.1 | 4.6 | 72.2 | 0.8 | 38.0 | 0.1 | 0.0 | 127.8 | 130.2 | 130.8 | 150.9 | 115.8 | | 16 | 168 | 23848.2 | 0.1 | 4.5 | 66.3 | 0.9 | 35.8 | 0.1 | 0.0 | 109.8 | 111.1 | 111.3 | 111.7 | 107.7 | | 16 | 176 | 23280.0 | 0.1 | 4.8 | 60.5 | 0.8 | 40.5 | 0.1 | 0.0 | 109.4 | 117.4 | 130.9 | 133.3 | 106.8 | | 16 | 184 | 21594.4 | 0.3 | 2.8 | 87.2 | 0.9 | 36.6 | 0.1 | 0.0 | 130.0 | 145.0 | 145.2 | 146.6 | 127.8 | | 16 | 192 | 20816.0 | 0.3 | 3.5 | 99.0 | 0.9 | 36.5 | 0.1 | 0.0 | 145.1 | 147.1 | 148.0 | 165.5 | 140.3 | | 16 | 200 | 20224.0 | 0.3 | 3.5 | 104.1 | 0.8 | 37.4 | 0.1 | 0.0 | 145.7 | 147.6 | 148.1 | 165.8 | 146.1 | | 16 | 208 | 21744.0 | 0.2 | 3.9 | 98.5 | 1.0 | 39.0 | 0.2 | 0.0 | 145.8 | 150.7 | 166.3 | 168.3 | 142.8 | | 16 | 216 | 20112.0 | 0.4 | 2.7 | 117.8 | 0.8 | 34.0 | 0.2 | 0.0 | 156.1 | 157.2 | 157.4 | 157.8 | 156.0 | | 16 | 224 | 23504.0 | 0.4 | 5.2 | 99.3 | 0.9 | 39.3 | 0.2 | 0.0 | 147.0 | 151.3 | 167.6 | 168.0 | 145.3 | | 16 | 232 | 24352.0 | 0.5 | 3.6 | 93.6 | 1.0 | 41.3 | 0.2 | 0.0 | 144.9 | 148.2 | 167.3 | 169.5 | 140.2 | | 16 | 240 | 25760.0 | 0.4 | 2.8 | 89.5 | 0.9 | 45.9 | 0.1 | 0.0 | 140.8 | 159.9 | 171.6 | 181.1 | 139.7 | | 16 | 248 | 23872.0 | 0.5 | 2.5 | 114.7 | 1.0 | 34.7 | 0.1 | 0.0 | 156.6 | 158.2 | 158.8 | 164.2 | 153.4 | | 16 | 256 | 24960.0 | 0.5 | 3.4 | 105.6 | 1.1 | 40.0 | 0.1 | 0.0 | 152.3 | 173.8 | 182.2 | 188.4 | 150.8 | </details> #### Online: NVIDIA A30, NVIDIA TensorRT with FP16, Dataset: traffic Our results were obtained using the following configuration: | Parameter Name | Parameter Value | |:-----------------------------|:-----------------------------| | GPU |NVIDIA A30 | | Backend |NVIDIA TensorRT | | Precision |FP16 | | Model format |NVIDIA TensorRT | | Max batch size |1024 | | Number of model instances |2| | Export Precision | FP32 | | NVIDIA TensorRT Capture CUDA Graph | Disabled | | Dataset | traffic | | Device | gpu | | Request Count | 500 | <table> <tbody> <tr> <td colspan="2" align="center"><img src="./reports/nvidia_a30_experiment_18_triton_performance_online_18/plots/latency_vs_concurrency.png"></td> </tr> </tbody> </table> <details> <summary>Results Table</summary> | Batch | Concurrency | Inferences/Second | Client Send (ms) | Network+Server Send/Recv (ms) | Server Queue (ms) | Server Compute Input (ms) | Server Compute Infer (ms) | Server Compute Output (ms) | Client Recv (ms) | p50 latency (ms) | p90 latency (ms) | p95 latency (ms) | p99 latency (ms) | avg latency (ms) | |--------:|--------------:|--------------------:|-------------------:|--------------------------------:|--------------------:|----------------------------:|----------------------------:|-----------------------------:|-------------------:|-------------------:|-------------------:|-------------------:|-------------------:|-------------------:| | 16 | 8 | 15104.0 | 0.1 | 0.5 | 3.6 | 0.1 | 4.0 | 0.1 | 0.0 | 8.4 | 8.4 | 8.5 | 8.5 | 8.4 | | 16 | 16 | 15328.0 | 0.1 | 0.7 | 8.5 | 0.2 | 7.1 | 0.1 | 0.0 | 16.8 | 20.8 | 21.1 | 23.1 | 16.6 | | 16 | 24 | 17072.0 | 0.1 | 1.2 | 10.4 | 0.3 | 10.2 | 0.1 | 0.0 | 23.6 | 30.2 | 30.6 | 32.2 | 22.3 | | 16 | 32 | 16176.0 | 0.1 | 1.8 | 14.0 | 0.3 | 14.4 | 0.1 | 0.0 | 33.5 | 35.9 | 36.0 | 36.5 | 30.6 | | 16 | 40 | 18288.0 | 0.1 | 1.7 | 17.3 | 0.3 | 14.5 | 0.1 | 0.0 | 35.8 | 39.6 | 39.9 | 41.3 | 34.0 | | 16 | 48 | 17136.0 | 0.1 | 2.0 | 18.0 | 0.4 | 22.8 | 0.1 | 0.0 | 45.6 | 51.5 | 52.5 | 53.9 | 43.4 | | 16 | 56 | 16992.0 | 0.1 | 2.9 | 22.3 | 0.5 | 26.1 | 0.1 | 0.0 | 55.4 | 56.8 | 57.2 | 57.5 | 51.9 | | 16 | 64 | 17552.0 | 0.1 | 2.8 | 25.2 | 0.5 | 26.7 | 0.1 | 0.0 | 56.2 | 65.9 | 66.3 | 66.6 | 55.4 | | 16 | 72 | 19552.0 | 0.1 | 3.3 | 28.8 | 0.6 | 25.4 | 0.1 | 0.0 | 65.2 | 66.6 | 67.0 | 69.4 | 58.3 | | 16 | 80 | 21072.0 | 0.1 | 3.2 | 26.2 | 0.7 | 29.3 | 0.2 | 0.0 | 62.3 | 65.4 | 66.0 | 66.3 | 59.7 | | 16 | 88 | 19392.0 | 0.1 | 2.3 | 36.0 | 0.8 | 30.6 | 0.1 | 0.0 | 68.1 | 82.9 | 83.7 | 84.1 | 69.9 | | 16 | 96 | 19168.0 | 0.1 | 3.5 | 38.0 | 0.7 | 33.9 | 0.2 | 0.0 | 79.2 | 80.2 | 80.6 | 83.3 | 76.3 | | 16 | 104 | 17920.0 | 0.1 | 3.1 | 51.8 | 0.8 | 32.2 | 0.2 | 0.0 | 92.5 | 93.4 | 93.8 | 94.3 | 88.2 | | 16 | 112 | 21296.0 | 0.1 | 3.8 | 39.7 | 1.0 | 34.7 | 0.2 | 0.0 | 83.4 | 84.3 | 84.8 | 104.0 | 79.4 | | 16 | 120 | 22032.0 | 0.1 | 3.1 | 45.0 | 0.8 | 33.0 | 0.2 | 0.0 | 82.9 | 93.0 | 93.5 | 94.7 | 82.2 | | 16 | 128 | 21882.1 | 0.1 | 3.1 | 53.6 | 0.9 | 32.5 | 0.2 | 0.0 | 93.0 | 93.6 | 93.8 | 94.4 | 90.4 | | 16 | 136 | 25552.0 | 0.1 | 3.8 | 41.3 | 1.0 | 37.3 | 0.2 | 0.0 | 83.9 | 93.7 | 105.3 | 108.0 | 83.7 | | 16 | 144 | 21904.0 | 0.1 | 5.5 | 60.9 | 0.8 | 33.6 | 0.2 | 0.0 | 103.9 | 113.3 | 113.4 | 132.9 | 101.1 | | 16 | 152 | 21456.0 | 0.1 | 3.6 | 66.5 | 0.8 | 35.6 | 0.2 | 0.0 | 109.4 | 110.0 | 110.2 | 110.5 | 106.8 | | 16 | 160 | 23040.0 | 0.2 | 3.3 | 59.4 | 0.9 | 40.4 | 0.2 | 0.0 | 109.7 | 129.7 | 130.1 | 130.9 | 104.3 | | 16 | 168 | 19600.0 | 0.2 | 0.9 | 88.8 | 0.8 | 34.2 | 0.1 | 0.0 | 128.7 | 131.4 | 144.9 | 145.6 | 125.0 | | 16 | 176 | 20880.0 | 0.2 | 4.6 | 84.9 | 0.9 | 34.9 | 0.1 | 0.0 | 129.2 | 130.0 | 130.6 | 133.1 | 125.6 | | 16 | 184 | 22409.6 | 0.2 | 6.5 | 78.3 | 1.1 | 40.1 | 0.1 | 0.0 | 129.6 | 146.7 | 147.9 | 149.9 | 126.2 | | 16 | 192 | 19456.0 | 0.2 | 3.9 | 101.8 | 0.9 | 35.5 | 0.2 | 0.0 | 145.9 | 147.1 | 147.3 | 147.7 | 142.4 | | 16 | 200 | 20155.8 | 0.2 | 3.7 | 105.2 | 1.0 | 35.6 | 0.1 | 0.0 | 146.6 | 147.3 | 147.7 | 148.3 | 145.9 | | 16 | 208 | 21040.0 | 0.3 | 3.8 | 100.1 | 0.8 | 40.2 | 0.1 | 0.0 | 145.7 | 165.6 | 166.2 | 172.1 | 145.4 | | 16 | 216 | 20784.0 | 0.4 | 2.7 | 117.4 | 0.8 | 34.0 | 0.1 | 0.0 | 155.5 | 156.4 | 156.6 | 156.9 | 155.3 | | 16 | 224 | 23344.0 | 0.5 | 3.6 | 99.0 | 0.8 | 41.6 | 0.1 | 0.0 | 149.9 | 157.3 | 173.8 | 190.6 | 145.7 | | 16 | 232 | 21760.0 | 0.4 | 3.2 | 117.4 | 0.9 | 34.2 | 0.2 | 0.0 | 156.7 | 157.3 | 157.5 | 158.1 | 156.3 | | 16 | 240 | 20784.0 | 0.2 | 4.4 | 126.7 | 1.0 | 34.1 | 0.1 | 0.0 | 166.6 | 169.1 | 169.5 | 169.8 | 166.6 | | 16 | 248 | 26352.0 | 0.3 | 3.7 | 107.7 | 1.1 | 32.3 | 0.1 | 0.0 | 146.9 | 149.2 | 163.2 | 169.4 | 145.3 | | 16 | 256 | 23408.0 | 0.4 | 4.9 | 116.1 | 1.1 | 42.3 | 0.1 | 0.0 | 163.0 | 197.6 | 201.1 | 204.3 | 164.9 | </details> #### Online: NVIDIA A30, PyTorch with FP16, Dataset: electricity Our results were obtained using the following configuration: | Parameter Name | Parameter Value | |:-----------------------------|:-----------------------------| | GPU |NVIDIA A30 | | Backend |PyTorch | | Precision |FP16 | | Model format |TorchScript Trace | | Max batch size |1024 | | Number of model instances |2| | Export Precision | FP32 | | Dataset | electricity | | Device | gpu | | Request Count | 500 | <table> <tbody> <tr> <td colspan="2" align="center"><img src="./reports/nvidia_a30_experiment_27_triton_performance_online_27/plots/latency_vs_concurrency.png"></td> </tr> </tbody> </table> <details> <summary>Results Table</summary> | Batch | Concurrency | Inferences/Second | Client Send (ms) | Network+Server Send/Recv (ms) | Server Queue (ms) | Server Compute Input (ms) | Server Compute Infer (ms) | Server Compute Output (ms) | Client Recv (ms) | p50 latency (ms) | p90 latency (ms) | p95 latency (ms) | p99 latency (ms) | avg latency (ms) | |--------:|--------------:|--------------------:|-------------------:|--------------------------------:|--------------------:|----------------------------:|----------------------------:|-----------------------------:|-------------------:|-------------------:|-------------------:|-------------------:|-------------------:|-------------------:| | 16 | 8 | 5528.0 | 0.1 | 0.8 | 8.1 | 0.5 | 13.1 | 0.3 | 0.0 | 26.2 | 28.1 | 28.7 | 30.3 | 22.8 | | 16 | 16 | 9120.0 | 0.1 | 0.6 | 10.3 | 0.7 | 10.5 | 5.3 | 0.0 | 30.8 | 33.5 | 34.7 | 35.8 | 27.5 | | 16 | 24 | 10384.0 | 0.1 | 0.8 | 14.0 | 1.1 | 10.6 | 9.3 | 0.0 | 39.3 | 42.4 | 43.1 | 46.0 | 35.8 | | 16 | 32 | 11076.9 | 0.1 | 1.2 | 18.8 | 1.4 | 10.2 | 13.2 | 0.0 | 48.5 | 51.1 | 51.5 | 54.6 | 44.9 | | 16 | 40 | 11328.0 | 0.1 | 2.0 | 21.6 | 2.3 | 10.7 | 18.4 | 0.0 | 58.8 | 62.0 | 63.2 | 67.5 | 55.1 | | 16 | 48 | 11296.0 | 0.1 | 3.2 | 25.3 | 5.1 | 9.3 | 22.1 | 0.0 | 67.7 | 73.3 | 76.0 | 79.1 | 65.1 | | 16 | 56 | 11440.0 | 0.1 | 3.3 | 29.6 | 5.0 | 9.9 | 26.1 | 0.0 | 77.3 | 82.5 | 83.9 | 92.3 | 74.0 | | 16 | 64 | 11600.0 | 0.1 | 2.9 | 35.5 | 7.6 | 9.3 | 29.0 | 0.0 | 88.5 | 95.2 | 98.9 | 113.5 | 84.4 | | 16 | 72 | 11316.7 | 0.1 | 4.3 | 38.1 | 16.0 | 7.7 | 29.3 | 0.0 | 99.4 | 103.1 | 123.0 | 125.8 | 95.5 | | 16 | 80 | 11664.0 | 0.1 | 4.0 | 46.0 | 18.0 | 7.5 | 28.0 | 0.0 | 108.4 | 112.7 | 116.1 | 126.0 | 103.7 | | 16 | 88 | 11472.0 | 0.1 | 3.0 | 47.8 | 19.8 | 8.2 | 34.4 | 0.0 | 119.7 | 128.6 | 131.9 | 135.5 | 113.3 | | 16 | 96 | 11760.0 | 0.1 | 4.4 | 53.1 | 22.1 | 7.3 | 36.1 | 0.0 | 128.7 | 131.5 | 132.1 | 133.3 | 123.1 | | 16 | 104 | 11840.0 | 0.1 | 5.4 | 59.4 | 5.7 | 9.8 | 51.0 | 0.0 | 132.7 | 138.7 | 138.9 | 175.8 | 131.5 | | 16 | 112 | 11728.0 | 0.1 | 4.2 | 59.1 | 16.9 | 8.8 | 51.3 | 0.0 | 146.7 | 162.7 | 164.0 | 168.4 | 140.3 | | 16 | 120 | 11796.2 | 0.1 | 5.3 | 54.2 | 20.6 | 7.6 | 61.4 | 0.0 | 155.3 | 164.2 | 172.6 | 173.1 | 149.2 | | 16 | 128 | 12272.0 | 0.1 | 6.3 | 64.6 | 16.7 | 7.6 | 61.5 | 0.0 | 165.7 | 175.9 | 194.4 | 197.7 | 156.8 | | 16 | 136 | 11680.0 | 0.1 | 6.0 | 74.7 | 33.5 | 6.6 | 48.7 | 0.0 | 178.5 | 183.0 | 183.9 | 186.4 | 169.5 | | 16 | 144 | 11408.0 | 0.1 | 5.5 | 76.6 | 33.3 | 7.1 | 55.4 | 0.0 | 190.7 | 198.8 | 203.2 | 204.6 | 178.0 | | 16 | 152 | 11456.0 | 0.1 | 4.7 | 87.4 | 28.8 | 7.2 | 60.8 | 0.0 | 193.9 | 199.5 | 200.2 | 201.1 | 189.0 | | 16 | 160 | 11444.6 | 0.2 | 4.7 | 94.3 | 24.3 | 7.0 | 67.1 | 0.0 | 198.0 | 199.4 | 199.5 | 199.6 | 197.5 | | 16 | 168 | 11040.0 | 0.1 | 7.5 | 89.1 | 35.2 | 6.8 | 70.2 | 0.0 | 214.2 | 220.1 | 222.9 | 225.2 | 208.9 | | 16 | 176 | 11536.0 | 0.2 | 4.7 | 97.1 | 39.1 | 7.0 | 67.9 | 0.0 | 221.9 | 239.7 | 242.6 | 255.8 | 216.0 | | 16 | 184 | 11136.0 | 0.1 | 6.5 | 101.3 | 41.8 | 7.1 | 67.2 | 0.0 | 231.3 | 236.7 | 240.0 | 240.4 | 224.1 | | 16 | 192 | 11376.0 | 0.2 | 6.4 | 106.9 | 47.0 | 7.6 | 68.9 | 0.0 | 245.5 | 252.9 | 256.1 | 265.9 | 237.1 | | 16 | 200 | 11840.0 | 0.3 | 5.0 | 110.3 | 46.4 | 7.0 | 72.7 | 0.0 | 255.0 | 262.0 | 267.0 | 267.9 | 241.8 | | 16 | 208 | 11680.0 | 0.2 | 5.3 | 122.0 | 37.8 | 7.6 | 78.0 | 0.0 | 252.1 | 254.0 | 309.6 | 311.0 | 250.9 | | 16 | 216 | 11280.0 | 0.2 | 6.0 | 151.5 | 41.8 | 6.9 | 59.4 | 0.0 | 270.5 | 279.9 | 283.2 | 283.9 | 265.8 | | 16 | 224 | 11152.0 | 0.4 | 5.9 | 127.1 | 51.8 | 7.0 | 79.1 | 0.0 | 280.9 | 283.7 | 284.6 | 285.1 | 271.3 | | 16 | 232 | 10848.0 | 0.2 | 5.0 | 158.1 | 41.7 | 7.8 | 72.7 | 0.0 | 287.4 | 306.0 | 315.8 | 316.9 | 285.5 | | 16 | 240 | 11088.0 | 0.2 | 10.1 | 166.0 | 34.4 | 7.2 | 78.0 | 0.0 | 296.1 | 318.6 | 348.7 | 354.4 | 295.8 | | 16 | 248 | 10485.5 | 0.3 | 5.8 | 174.3 | 40.1 | 7.2 | 75.4 | 0.0 | 307.6 | 316.7 | 322.0 | 323.7 | 303.2 | | 16 | 256 | 11168.0 | 0.4 | 4.5 | 178.3 | 45.8 | 7.1 | 77.2 | 0.0 | 320.5 | 341.6 | 342.6 | 348.6 | 313.2 | </details> #### Online: NVIDIA A30, PyTorch with FP16, Dataset: traffic Our results were obtained using the following configuration: | Parameter Name | Parameter Value | |:-----------------------------|:-----------------------------| | GPU |NVIDIA A30 | | Backend |PyTorch | | Precision |FP16 | | Model format |TorchScript Trace | | Max batch size |1024 | | Number of model instances |2| | Export Precision | FP32 | | Dataset | traffic | | Device | gpu | | Request Count | 500 | <table> <tbody> <tr> <td colspan="2" align="center"><img src="./reports/nvidia_a30_experiment_28_triton_performance_online_28/plots/latency_vs_concurrency.png"></td> </tr> </tbody> </table> <details> <summary>Results Table</summary> | Batch | Concurrency | Inferences/Second | Client Send (ms) | Network+Server Send/Recv (ms) | Server Queue (ms) | Server Compute Input (ms) | Server Compute Infer (ms) | Server Compute Output (ms) | Client Recv (ms) | p50 latency (ms) | p90 latency (ms) | p95 latency (ms) | p99 latency (ms) | avg latency (ms) | |--------:|--------------:|--------------------:|-------------------:|--------------------------------:|--------------------:|----------------------------:|----------------------------:|-----------------------------:|-------------------:|-------------------:|-------------------:|-------------------:|-------------------:|-------------------:| | 16 | 8 | 6544.0 | 0.1 | 0.5 | 7.0 | 0.4 | 8.8 | 2.6 | 0.0 | 22.1 | 23.9 | 24.5 | 25.8 | 19.3 | | 16 | 16 | 9456.0 | 0.1 | 0.6 | 9.7 | 0.8 | 8.7 | 6.9 | 0.0 | 30.5 | 32.8 | 33.4 | 34.2 | 26.6 | | 16 | 24 | 10704.0 | 0.1 | 0.8 | 13.8 | 0.9 | 8.5 | 11.3 | 0.0 | 39.0 | 41.9 | 42.2 | 42.7 | 35.4 | | 16 | 32 | 11472.0 | 0.1 | 0.9 | 18.3 | 1.3 | 8.4 | 15.0 | 0.0 | 48.1 | 50.2 | 51.1 | 51.9 | 44.0 | | 16 | 40 | 11568.0 | 0.1 | 1.3 | 21.8 | 1.5 | 8.6 | 20.1 | 0.0 | 57.7 | 60.4 | 60.8 | 62.3 | 53.4 | | 16 | 48 | 12000.0 | 0.1 | 2.8 | 24.6 | 1.3 | 8.7 | 25.6 | 0.0 | 66.3 | 68.3 | 68.6 | 69.3 | 63.1 | | 16 | 56 | 12048.0 | 0.1 | 3.1 | 20.9 | 1.6 | 8.3 | 37.6 | 0.0 | 75.2 | 77.2 | 77.9 | 78.8 | 71.5 | | 16 | 64 | 11824.0 | 0.1 | 2.8 | 29.1 | 1.8 | 8.5 | 38.8 | 0.0 | 85.2 | 87.8 | 88.4 | 89.3 | 81.0 | | 16 | 72 | 11888.0 | 0.1 | 2.2 | 36.1 | 2.0 | 8.8 | 40.8 | 0.0 | 93.9 | 96.0 | 96.5 | 101.8 | 90.0 | | 16 | 80 | 11712.0 | 0.1 | 3.7 | 44.4 | 10.6 | 8.1 | 36.3 | 0.0 | 107.1 | 119.0 | 121.6 | 128.2 | 103.3 | | 16 | 88 | 12240.0 | 0.1 | 4.5 | 44.7 | 5.7 | 7.9 | 48.6 | 0.0 | 115.8 | 119.8 | 130.2 | 153.3 | 111.5 | | 16 | 96 | 11888.0 | 0.1 | 3.0 | 48.8 | 10.6 | 7.8 | 50.0 | 0.0 | 127.1 | 135.0 | 152.9 | 179.4 | 120.3 | | 16 | 104 | 12096.0 | 0.1 | 3.4 | 59.4 | 10.2 | 7.4 | 48.6 | 0.0 | 134.8 | 139.1 | 146.7 | 158.2 | 129.1 | | 16 | 112 | 11408.0 | 0.1 | 5.3 | 57.8 | 27.2 | 5.8 | 46.0 | 0.0 | 146.4 | 147.8 | 149.7 | 155.4 | 142.2 | | 16 | 120 | 11812.2 | 0.1 | 6.7 | 63.8 | 14.0 | 6.8 | 57.3 | 0.0 | 153.3 | 157.9 | 160.4 | 161.9 | 148.7 | | 16 | 128 | 11632.0 | 0.1 | 4.9 | 69.6 | 15.9 | 7.3 | 59.2 | 0.0 | 163.6 | 177.1 | 180.0 | 205.3 | 157.0 | | 16 | 136 | 11620.4 | 0.1 | 3.5 | 76.0 | 9.8 | 8.2 | 68.3 | 0.0 | 172.9 | 182.9 | 195.5 | 196.8 | 166.0 | | 16 | 144 | 11824.0 | 0.1 | 3.3 | 81.3 | 24.9 | 7.0 | 60.9 | 0.0 | 181.9 | 187.9 | 210.9 | 211.8 | 177.5 | | 16 | 152 | 12032.0 | 0.1 | 3.8 | 85.9 | 22.9 | 7.1 | 67.1 | 0.0 | 192.9 | 219.2 | 239.1 | 252.4 | 187.0 | | 16 | 160 | 12048.0 | 0.1 | 4.0 | 89.0 | 21.3 | 6.5 | 72.7 | 0.0 | 199.7 | 206.4 | 230.8 | 246.6 | 193.7 | | 16 | 168 | 11456.0 | 0.1 | 4.4 | 93.2 | 30.2 | 5.7 | 70.5 | 0.0 | 208.4 | 209.8 | 211.8 | 212.0 | 204.3 | | 16 | 176 | 11584.0 | 0.2 | 5.7 | 100.5 | 38.5 | 6.5 | 64.0 | 0.0 | 219.8 | 221.4 | 222.1 | 223.7 | 215.4 | | 16 | 184 | 12096.0 | 0.2 | 5.6 | 103.2 | 40.9 | 6.0 | 69.2 | 0.0 | 230.2 | 233.5 | 233.8 | 233.9 | 225.0 | | 16 | 192 | 11200.0 | 0.2 | 6.2 | 107.5 | 35.4 | 6.5 | 79.3 | 0.0 | 241.6 | 251.3 | 254.8 | 255.0 | 235.0 | | 16 | 200 | 10880.0 | 0.3 | 5.0 | 113.9 | 31.7 | 7.0 | 88.9 | 0.0 | 255.2 | 267.0 | 294.9 | 296.2 | 246.8 | | 16 | 208 | 11984.0 | 0.1 | 6.4 | 116.5 | 45.0 | 6.2 | 78.1 | 0.0 | 261.3 | 267.0 | 268.0 | 268.4 | 252.3 | | 16 | 216 | 11632.0 | 0.2 | 6.9 | 121.8 | 39.8 | 6.8 | 90.8 | 0.0 | 275.9 | 280.9 | 282.2 | 282.5 | 266.4 | | 16 | 224 | 11140.9 | 0.3 | 6.6 | 128.6 | 49.4 | 6.8 | 84.3 | 0.0 | 284.0 | 288.6 | 294.6 | 295.2 | 275.8 | | 16 | 232 | 11568.0 | 0.2 | 5.2 | 162.0 | 15.2 | 8.1 | 89.0 | 0.0 | 285.6 | 312.9 | 315.5 | 335.5 | 279.7 | | 16 | 240 | 11696.0 | 0.3 | 5.3 | 167.3 | 40.9 | 6.2 | 75.4 | 0.0 | 300.4 | 309.2 | 317.6 | 318.4 | 295.3 | | 16 | 248 | 11040.0 | 0.2 | 8.0 | 174.9 | 32.4 | 7.1 | 82.8 | 0.0 | 307.4 | 327.0 | 370.7 | 371.9 | 305.6 | | 16 | 256 | 10528.0 | 0.5 | 4.0 | 179.5 | 42.6 | 6.8 | 80.8 | 0.0 | 321.4 | 325.7 | 326.0 | 327.2 | 314.2 | </details> #### Online: NVIDIA DGX-1 (1x V100 32GB), NVIDIA TensorRT with FP16, Dataset: electricity Our results were obtained using the following configuration: | Parameter Name | Parameter Value | |:-----------------------------|:-----------------------------| | GPU |NVIDIA DGX-1 (1x V100 32GB) | | Backend |NVIDIA TensorRT | | Precision |FP16 | | Model format |NVIDIA TensorRT | | Max batch size |1024 | | Number of model instances |2| | Export Precision | FP32 | | NVIDIA TensorRT Capture CUDA Graph | Disabled | | Dataset | electricity | | Device | gpu | | Request Count | 500 | <table> <tbody> <tr> <td colspan="2" align="center"><img src="./reports/nvidia_dgx-1_(1x_v100_32gb)_experiment_17_triton_performance_online_17/plots/latency_vs_concurrency.png"></td> </tr> </tbody> </table> <details> <summary>Results Table</summary> | Batch | Concurrency | Inferences/Second | Client Send (ms) | Network+Server Send/Recv (ms) | Server Queue (ms) | Server Compute Input (ms) | Server Compute Infer (ms) | Server Compute Output (ms) | Client Recv (ms) | p50 latency (ms) | p90 latency (ms) | p95 latency (ms) | p99 latency (ms) | avg latency (ms) | |--------:|--------------:|--------------------:|-------------------:|--------------------------------:|--------------------:|----------------------------:|----------------------------:|-----------------------------:|-------------------:|-------------------:|-------------------:|-------------------:|-------------------:|-------------------:| | 16 | 8 | 11776.0 | 0.1 | 0.5 | 4.7 | 0.2 | 5.3 | 0.0 | 0.0 | 10.8 | 10.9 | 11.0 | 11.0 | 10.7 | | 16 | 16 | 11360.0 | 0.1 | 0.7 | 11.7 | 0.2 | 9.4 | 0.0 | 0.0 | 23.1 | 28.6 | 32.0 | 32.2 | 22.1 | | 16 | 24 | 12656.0 | 0.1 | 1.0 | 15.8 | 0.3 | 12.8 | 0.0 | 0.0 | 33.8 | 34.3 | 34.4 | 37.7 | 30.1 | | 16 | 32 | 11968.0 | 0.1 | 1.6 | 20.9 | 0.4 | 18.8 | 0.0 | 0.0 | 44.2 | 48.0 | 48.1 | 48.7 | 41.8 | | 16 | 40 | 14640.0 | 0.1 | 1.5 | 20.9 | 0.4 | 19.6 | 0.0 | 0.0 | 47.6 | 48.0 | 48.0 | 48.1 | 42.6 | | 16 | 48 | 13280.0 | 0.1 | 1.6 | 32.8 | 0.4 | 21.3 | 0.0 | 0.0 | 62.9 | 63.4 | 63.5 | 63.6 | 56.3 | | 16 | 56 | 13232.0 | 0.1 | 1.9 | 28.4 | 0.6 | 33.8 | 0.0 | 0.0 | 66.9 | 71.8 | 72.2 | 72.3 | 64.8 | | 16 | 64 | 12656.0 | 0.1 | 1.9 | 42.4 | 0.6 | 32.3 | 0.0 | 0.0 | 82.2 | 83.0 | 83.6 | 83.8 | 77.3 | | 16 | 72 | 16671.3 | 0.1 | 2.0 | 40.8 | 0.5 | 24.0 | 0.0 | 0.0 | 73.4 | 74.0 | 83.6 | 84.0 | 67.5 | | 16 | 80 | 16384.0 | 0.1 | 2.1 | 36.3 | 0.6 | 34.6 | 0.1 | 0.0 | 76.8 | 77.3 | 77.4 | 77.6 | 73.7 | | 16 | 88 | 13728.0 | 0.1 | 2.3 | 53.4 | 0.6 | 38.5 | 0.0 | 0.0 | 100.5 | 101.3 | 101.5 | 101.7 | 95.0 | | 16 | 96 | 15104.0 | 0.1 | 3.0 | 53.7 | 0.7 | 39.6 | 0.1 | 0.0 | 101.2 | 101.8 | 102.0 | 102.2 | 97.1 | | 16 | 104 | 14512.0 | 0.1 | 2.0 | 66.6 | 0.7 | 38.5 | 0.1 | 0.0 | 111.1 | 111.5 | 111.7 | 111.9 | 107.9 | | 16 | 112 | 18464.0 | 0.1 | 3.0 | 49.7 | 1.0 | 40.8 | 0.1 | 0.0 | 96.6 | 101.7 | 101.9 | 102.2 | 94.7 | | 16 | 120 | 17760.0 | 0.1 | 2.9 | 63.4 | 1.2 | 37.7 | 0.1 | 0.0 | 112.1 | 113.4 | 113.8 | 113.9 | 105.4 | | 16 | 128 | 17808.0 | 0.1 | 3.9 | 64.6 | 0.9 | 39.5 | 0.1 | 0.0 | 111.7 | 112.3 | 112.5 | 112.5 | 109.0 | | 16 | 136 | 16848.0 | 0.1 | 2.7 | 74.9 | 0.8 | 41.1 | 0.1 | 0.0 | 129.9 | 130.6 | 130.7 | 130.7 | 119.7 | | 16 | 144 | 19216.0 | 0.1 | 3.7 | 66.2 | 1.0 | 38.9 | 0.1 | 0.0 | 112.5 | 113.3 | 113.5 | 114.1 | 110.1 | | 16 | 152 | 20864.0 | 0.1 | 4.3 | 65.4 | 1.0 | 39.1 | 0.2 | 0.0 | 112.3 | 113.4 | 113.7 | 114.9 | 110.2 | | 16 | 160 | 18288.0 | 0.1 | 3.8 | 81.3 | 1.2 | 42.7 | 0.1 | 0.0 | 131.4 | 133.1 | 134.3 | 135.1 | 129.2 | | 16 | 168 | 19152.0 | 0.2 | 3.1 | 81.6 | 1.1 | 42.6 | 0.1 | 0.0 | 131.2 | 131.6 | 131.7 | 131.8 | 128.7 | | 16 | 176 | 15152.0 | 0.2 | 2.5 | 127.3 | 0.9 | 42.8 | 0.1 | 0.0 | 174.9 | 175.3 | 175.4 | 175.4 | 173.9 | | 16 | 184 | 15824.0 | 0.1 | 3.9 | 126.7 | 1.0 | 42.8 | 0.1 | 0.0 | 175.5 | 176.1 | 176.3 | 176.4 | 174.6 | | 16 | 192 | 18096.0 | 0.2 | 3.0 | 113.1 | 1.0 | 40.2 | 0.1 | 0.0 | 155.7 | 174.7 | 174.9 | 175.0 | 157.6 | | 16 | 200 | 18128.0 | 0.2 | 3.1 | 121.0 | 1.1 | 39.1 | 0.1 | 0.0 | 165.0 | 165.9 | 166.2 | 166.6 | 164.7 | | 16 | 208 | 16720.0 | 0.3 | 3.1 | 127.9 | 1.2 | 42.9 | 0.2 | 0.0 | 176.3 | 178.0 | 178.9 | 179.2 | 175.5 | | 16 | 216 | 18221.8 | 0.4 | 2.4 | 127.4 | 1.1 | 42.6 | 0.1 | 0.0 | 174.9 | 175.2 | 175.3 | 175.4 | 174.0 | | 16 | 224 | 18944.0 | 0.3 | 3.1 | 127.4 | 1.1 | 42.8 | 0.1 | 0.0 | 175.8 | 176.3 | 176.4 | 176.5 | 174.9 | | 16 | 232 | 19484.5 | 0.4 | 3.3 | 126.9 | 1.2 | 42.7 | 0.1 | 0.0 | 175.2 | 176.5 | 176.8 | 177.2 | 174.7 | | 16 | 240 | 17696.0 | 0.5 | 2.1 | 147.7 | 1.2 | 40.8 | 0.1 | 0.0 | 199.8 | 200.7 | 200.8 | 201.1 | 192.3 | | 16 | 248 | 17856.0 | 0.5 | 3.0 | 150.1 | 1.1 | 41.3 | 0.1 | 0.0 | 199.8 | 201.0 | 201.2 | 201.5 | 196.1 | | 16 | 256 | 17712.0 | 0.6 | 2.6 | 155.2 | 1.2 | 41.4 | 0.2 | 0.0 | 201.5 | 202.3 | 202.6 | 202.7 | 201.2 | </details> #### Online: NVIDIA DGX-1 (1x V100 32GB), NVIDIA TensorRT with FP16, Dataset: traffic Our results were obtained using the following configuration: | Parameter Name | Parameter Value | |:-----------------------------|:-----------------------------| | GPU |NVIDIA DGX-1 (1x V100 32GB) | | Backend |NVIDIA TensorRT | | Precision |FP16 | | Model format |NVIDIA TensorRT | | Max batch size |1024 | | Number of model instances |2| | Export Precision | FP32 | | NVIDIA TensorRT Capture CUDA Graph | Disabled | | Dataset | traffic | | Device | gpu | | Request Count | 500 | <table> <tbody> <tr> <td colspan="2" align="center"><img src="./reports/nvidia_dgx-1_(1x_v100_32gb)_experiment_18_triton_performance_online_18/plots/latency_vs_concurrency.png"></td> </tr> </tbody> </table> <details> <summary>Results Table</summary> | Batch | Concurrency | Inferences/Second | Client Send (ms) | Network+Server Send/Recv (ms) | Server Queue (ms) | Server Compute Input (ms) | Server Compute Infer (ms) | Server Compute Output (ms) | Client Recv (ms) | p50 latency (ms) | p90 latency (ms) | p95 latency (ms) | p99 latency (ms) | avg latency (ms) | |--------:|--------------:|--------------------:|-------------------:|--------------------------------:|--------------------:|----------------------------:|----------------------------:|-----------------------------:|-------------------:|-------------------:|-------------------:|-------------------:|-------------------:|-------------------:| | 16 | 8 | 12083.9 | 0.1 | 0.4 | 4.6 | 0.2 | 5.1 | 0.0 | 0.0 | 10.5 | 10.7 | 10.7 | 10.8 | 10.5 | | 16 | 16 | 11248.0 | 0.1 | 0.7 | 11.3 | 0.2 | 10.1 | 0.0 | 0.0 | 23.6 | 28.8 | 32.4 | 32.7 | 22.5 | | 16 | 24 | 12048.0 | 0.1 | 0.8 | 15.3 | 0.3 | 14.0 | 0.0 | 0.0 | 32.5 | 38.9 | 42.4 | 42.7 | 30.6 | | 16 | 32 | 13808.0 | 0.1 | 1.0 | 14.8 | 0.3 | 19.3 | 0.1 | 0.0 | 38.6 | 42.5 | 42.6 | 44.0 | 35.5 | | 16 | 40 | 14160.0 | 0.1 | 1.8 | 22.2 | 0.4 | 19.7 | 0.0 | 0.0 | 44.3 | 53.9 | 54.1 | 57.7 | 44.1 | | 16 | 48 | 13664.0 | 0.1 | 2.1 | 25.4 | 0.6 | 27.1 | 0.0 | 0.0 | 58.5 | 67.6 | 68.2 | 68.3 | 55.3 | | 16 | 56 | 14624.0 | 0.1 | 1.4 | 34.6 | 0.5 | 22.1 | 0.0 | 0.0 | 63.5 | 63.8 | 63.8 | 74.0 | 58.8 | | 16 | 64 | 18784.0 | 0.1 | 1.7 | 27.6 | 0.5 | 22.9 | 0.0 | 0.0 | 53.9 | 58.2 | 58.5 | 63.6 | 52.7 | | 16 | 72 | 15584.0 | 0.1 | 2.8 | 33.5 | 0.6 | 34.3 | 0.0 | 0.0 | 76.2 | 77.3 | 77.4 | 77.6 | 71.3 | | 16 | 80 | 14000.0 | 0.1 | 2.2 | 52.8 | 0.6 | 32.8 | 0.0 | 0.0 | 91.7 | 92.7 | 92.8 | 92.8 | 88.4 | | 16 | 88 | 13760.0 | 0.1 | 2.4 | 55.0 | 0.6 | 38.9 | 0.1 | 0.0 | 100.5 | 101.6 | 101.7 | 102.0 | 96.9 | | 16 | 96 | 18864.0 | 0.1 | 2.8 | 41.3 | 0.8 | 33.8 | 0.1 | 0.0 | 82.1 | 83.0 | 83.3 | 83.4 | 78.8 | | 16 | 104 | 18000.0 | 0.1 | 3.0 | 52.9 | 0.7 | 32.7 | 0.1 | 0.0 | 91.9 | 92.8 | 92.9 | 93.0 | 89.4 | | 16 | 112 | 16896.0 | 0.1 | 3.3 | 56.5 | 0.9 | 39.1 | 0.1 | 0.0 | 102.0 | 103.7 | 111.8 | 112.4 | 100.0 | | 16 | 120 | 20144.0 | 0.1 | 3.2 | 52.5 | 0.8 | 33.6 | 0.1 | 0.0 | 92.7 | 93.7 | 93.8 | 93.9 | 90.3 | | 16 | 128 | 19024.0 | 0.1 | 2.9 | 55.0 | 1.0 | 40.4 | 0.1 | 0.0 | 101.8 | 102.9 | 103.1 | 103.2 | 99.5 | | 16 | 136 | 20560.0 | 0.1 | 3.8 | 55.1 | 1.0 | 39.4 | 0.1 | 0.0 | 101.8 | 102.9 | 103.0 | 103.2 | 99.5 | | 16 | 144 | 17264.0 | 0.2 | 2.7 | 81.1 | 1.0 | 42.5 | 0.1 | 0.0 | 130.5 | 131.2 | 131.3 | 131.7 | 127.6 | | 16 | 152 | 18352.0 | 0.2 | 2.8 | 82.8 | 0.9 | 37.6 | 0.1 | 0.0 | 125.2 | 125.5 | 125.6 | 125.7 | 124.4 | | 16 | 160 | 16016.0 | 0.1 | 1.0 | 99.0 | 0.8 | 37.6 | 0.1 | 0.0 | 135.9 | 154.3 | 154.3 | 154.4 | 138.7 | | 16 | 168 | 19200.0 | 0.1 | 3.7 | 81.0 | 1.1 | 42.6 | 0.2 | 0.0 | 131.1 | 132.0 | 132.2 | 132.3 | 128.7 | | 16 | 176 | 16480.0 | 0.1 | 2.5 | 112.7 | 0.9 | 40.8 | 0.1 | 0.0 | 156.3 | 174.0 | 174.2 | 174.3 | 157.1 | | 16 | 184 | 16528.0 | 0.2 | 4.1 | 120.3 | 1.0 | 41.3 | 0.1 | 0.0 | 174.3 | 174.9 | 175.1 | 175.6 | 167.1 | | 16 | 192 | 18512.0 | 0.3 | 2.3 | 109.9 | 1.1 | 40.8 | 0.1 | 0.0 | 156.5 | 158.0 | 158.5 | 158.7 | 154.6 | | 16 | 200 | 16735.3 | 0.2 | 3.0 | 126.4 | 1.0 | 42.7 | 0.1 | 0.0 | 174.2 | 174.9 | 175.1 | 175.2 | 173.5 | | 16 | 208 | 17584.0 | 0.3 | 2.9 | 126.9 | 1.1 | 42.5 | 0.1 | 0.0 | 175.0 | 175.4 | 175.5 | 176.0 | 173.9 | | 16 | 216 | 18301.7 | 0.4 | 2.6 | 127.2 | 1.1 | 42.5 | 0.1 | 0.0 | 174.8 | 175.1 | 175.2 | 175.4 | 174.0 | | 16 | 224 | 19952.0 | 0.4 | 2.6 | 127.2 | 1.1 | 39.1 | 0.1 | 0.0 | 170.7 | 172.2 | 172.5 | 173.2 | 170.6 | | 16 | 232 | 19536.0 | 0.5 | 2.6 | 127.0 | 1.2 | 42.5 | 0.1 | 0.0 | 174.8 | 175.4 | 175.5 | 175.7 | 173.9 | | 16 | 240 | 18592.0 | 0.4 | 2.9 | 144.2 | 1.3 | 41.5 | 0.1 | 0.0 | 190.5 | 191.6 | 191.8 | 192.1 | 190.3 | | 16 | 248 | 17952.0 | 0.3 | 3.3 | 154.6 | 1.1 | 40.2 | 0.1 | 0.0 | 200.4 | 201.1 | 201.4 | 202.0 | 199.8 | | 16 | 256 | 19616.0 | 0.5 | 2.8 | 144.7 | 1.3 | 41.3 | 0.1 | 0.0 | 190.8 | 192.4 | 192.6 | 193.2 | 190.6 | </details> #### Online: NVIDIA DGX-1 (1x V100 32GB), PyTorch with FP16, Dataset: electricity Our results were obtained using the following configuration: | Parameter Name | Parameter Value | |:-----------------------------|:-----------------------------| | GPU |NVIDIA DGX-1 (1x V100 32GB) | | Backend |PyTorch | | Precision |FP16 | | Model format |TorchScript Trace | | Max batch size |1024 | | Number of model instances |2| | Export Precision | FP32 | | Dataset | electricity | | Device | gpu | | Request Count | 500 | <table> <tbody> <tr> <td colspan="2" align="center"><img src="./reports/nvidia_dgx-1_(1x_v100_32gb)_experiment_27_triton_performance_online_27/plots/latency_vs_concurrency.png"></td> </tr> </tbody> </table> <details> <summary>Results Table</summary> | Batch | Concurrency | Inferences/Second | Client Send (ms) | Network+Server Send/Recv (ms) | Server Queue (ms) | Server Compute Input (ms) | Server Compute Infer (ms) | Server Compute Output (ms) | Client Recv (ms) | p50 latency (ms) | p90 latency (ms) | p95 latency (ms) | p99 latency (ms) | avg latency (ms) | |--------:|--------------:|--------------------:|-------------------:|--------------------------------:|--------------------:|----------------------------:|----------------------------:|-----------------------------:|-------------------:|-------------------:|-------------------:|-------------------:|-------------------:|-------------------:| | 16 | 8 | 5008.0 | 0.1 | 0.6 | 9.4 | 0.4 | 11.3 | 3.7 | 0.0 | 29.2 | 30.5 | 31.3 | 32.9 | 25.5 | | 16 | 16 | 7016.0 | 0.1 | 0.7 | 13.5 | 0.8 | 11.7 | 8.9 | 0.0 | 41.2 | 42.9 | 43.4 | 44.2 | 35.7 | | 16 | 24 | 8560.0 | 0.1 | 1.0 | 17.5 | 1.0 | 11.9 | 12.7 | 0.0 | 49.4 | 51.3 | 51.9 | 53.1 | 44.2 | | 16 | 32 | 9264.0 | 0.1 | 1.1 | 21.4 | 1.4 | 11.9 | 17.0 | 0.0 | 57.9 | 59.1 | 59.3 | 59.6 | 52.9 | | 16 | 40 | 10336.0 | 0.1 | 1.9 | 23.2 | 1.5 | 12.0 | 22.3 | 0.0 | 65.8 | 67.6 | 67.9 | 68.2 | 60.9 | | 16 | 48 | 10064.0 | 0.1 | 2.6 | 22.0 | 1.7 | 11.8 | 32.6 | 0.0 | 75.7 | 76.6 | 76.7 | 77.4 | 70.8 | | 16 | 56 | 10512.0 | 0.1 | 2.5 | 20.1 | 1.8 | 11.6 | 44.8 | 0.0 | 85.6 | 86.8 | 87.8 | 88.0 | 80.9 | | 16 | 64 | 10848.0 | 0.1 | 3.1 | 30.1 | 1.9 | 11.7 | 42.2 | 0.0 | 93.8 | 95.9 | 96.0 | 99.7 | 89.2 | | 16 | 72 | 10800.0 | 0.1 | 2.9 | 22.0 | 2.0 | 11.3 | 61.7 | 0.0 | 104.0 | 104.8 | 105.6 | 107.4 | 99.8 | | 16 | 80 | 10976.0 | 0.1 | 2.8 | 38.7 | 2.2 | 11.3 | 52.2 | 0.0 | 111.6 | 112.5 | 113.3 | 116.0 | 107.3 | | 16 | 88 | 11200.0 | 0.1 | 3.4 | 47.7 | 3.1 | 11.7 | 50.9 | 0.0 | 120.7 | 122.2 | 124.2 | 124.7 | 116.8 | | 16 | 96 | 11152.0 | 0.1 | 2.8 | 54.7 | 3.3 | 11.0 | 54.2 | 0.0 | 130.4 | 132.2 | 133.0 | 133.9 | 126.1 | | 16 | 104 | 11312.0 | 0.1 | 4.2 | 60.6 | 7.2 | 12.2 | 51.5 | 0.0 | 138.5 | 144.9 | 161.8 | 173.3 | 135.8 | | 16 | 112 | 11216.0 | 0.1 | 4.6 | 67.1 | 3.2 | 10.5 | 60.7 | 0.0 | 150.1 | 151.5 | 152.3 | 154.1 | 146.2 | | 16 | 120 | 10736.0 | 0.1 | 4.6 | 73.0 | 10.8 | 10.3 | 58.1 | 0.0 | 161.5 | 162.4 | 166.4 | 173.6 | 157.0 | | 16 | 128 | 11504.0 | 0.1 | 3.5 | 77.2 | 7.0 | 9.8 | 66.2 | 0.0 | 168.8 | 171.6 | 172.7 | 186.1 | 163.8 | | 16 | 136 | 11120.0 | 0.1 | 4.5 | 81.4 | 8.8 | 10.3 | 68.5 | 0.0 | 177.7 | 179.5 | 181.3 | 191.2 | 173.5 | | 16 | 144 | 11808.0 | 0.1 | 4.7 | 84.3 | 8.4 | 10.7 | 73.0 | 0.0 | 185.0 | 193.4 | 196.4 | 202.1 | 181.2 | | 16 | 152 | 11168.0 | 0.1 | 3.7 | 91.8 | 28.3 | 8.6 | 63.1 | 0.0 | 199.6 | 203.2 | 203.3 | 209.8 | 195.7 | | 16 | 160 | 11392.0 | 0.1 | 5.2 | 84.7 | 21.9 | 9.6 | 81.9 | 0.0 | 205.7 | 220.0 | 248.4 | 248.8 | 203.4 | | 16 | 168 | 11696.0 | 0.1 | 4.9 | 103.6 | 10.9 | 10.1 | 82.6 | 0.0 | 216.4 | 224.8 | 269.6 | 270.7 | 212.1 | | 16 | 176 | 10912.0 | 0.1 | 5.9 | 105.3 | 30.6 | 9.9 | 73.6 | 0.0 | 230.7 | 235.1 | 235.4 | 235.7 | 225.3 | | 16 | 184 | 11312.0 | 0.2 | 4.2 | 110.4 | 28.5 | 9.5 | 82.6 | 0.0 | 239.8 | 248.2 | 271.9 | 272.2 | 235.3 | | 16 | 192 | 10992.0 | 0.1 | 5.4 | 113.3 | 43.4 | 8.6 | 70.0 | 0.0 | 246.1 | 248.0 | 248.3 | 248.8 | 241.0 | | 16 | 200 | 11360.0 | 0.1 | 5.8 | 116.5 | 36.6 | 9.9 | 77.5 | 0.0 | 251.4 | 259.3 | 272.8 | 273.2 | 246.4 | | 16 | 208 | 11360.0 | 0.1 | 6.1 | 122.2 | 43.4 | 8.5 | 77.2 | 0.0 | 259.1 | 263.0 | 265.2 | 265.9 | 257.6 | | 16 | 216 | 11296.0 | 0.3 | 3.3 | 129.2 | 37.6 | 8.7 | 88.9 | 0.0 | 272.2 | 275.7 | 275.9 | 276.3 | 267.9 | | 16 | 224 | 10800.0 | 0.2 | 5.2 | 132.7 | 43.4 | 8.3 | 86.3 | 0.0 | 277.4 | 281.9 | 282.2 | 282.9 | 276.1 | | 16 | 232 | 11184.0 | 0.4 | 3.2 | 170.0 | 12.8 | 10.5 | 91.9 | 0.0 | 276.9 | 334.5 | 335.1 | 335.5 | 288.8 | | 16 | 240 | 10992.0 | 0.4 | 6.2 | 175.9 | 27.0 | 9.4 | 84.9 | 0.0 | 301.9 | 342.6 | 348.0 | 348.2 | 303.8 | | 16 | 248 | 10432.0 | 0.4 | 3.8 | 179.2 | 12.9 | 10.8 | 98.1 | 0.0 | 314.7 | 356.4 | 376.4 | 377.8 | 305.2 | | 16 | 256 | 10896.0 | 0.5 | 3.7 | 185.5 | 38.1 | 8.6 | 83.4 | 0.0 | 323.5 | 329.8 | 332.4 | 332.7 | 319.6 | </details> #### Online: NVIDIA DGX-1 (1x V100 32GB), PyTorch with FP16, Dataset: traffic Our results were obtained using the following configuration: | Parameter Name | Parameter Value | |:-----------------------------|:-----------------------------| | GPU |NVIDIA DGX-1 (1x V100 32GB) | | Backend |PyTorch | | Precision |FP16 | | Model format |TorchScript Trace | | Max batch size |1024 | | Number of model instances |2| | Export Precision | FP32 | | Dataset | traffic | | Device | gpu | | Request Count | 500 | <table> <tbody> <tr> <td colspan="2" align="center"><img src="./reports/nvidia_dgx-1_(1x_v100_32gb)_experiment_28_triton_performance_online_28/plots/latency_vs_concurrency.png"></td> </tr> </tbody> </table> <details> <summary>Results Table</summary> | Batch | Concurrency | Inferences/Second | Client Send (ms) | Network+Server Send/Recv (ms) | Server Queue (ms) | Server Compute Input (ms) | Server Compute Infer (ms) | Server Compute Output (ms) | Client Recv (ms) | p50 latency (ms) | p90 latency (ms) | p95 latency (ms) | p99 latency (ms) | avg latency (ms) | |--------:|--------------:|--------------------:|-------------------:|--------------------------------:|--------------------:|----------------------------:|----------------------------:|-----------------------------:|-------------------:|-------------------:|-------------------:|-------------------:|-------------------:|-------------------:| | 16 | 8 | 4992.0 | 0.1 | 0.6 | 9.5 | 0.4 | 11.2 | 3.6 | 0.0 | 28.9 | 29.9 | 30.2 | 32.2 | 25.3 | | 16 | 16 | 7192.0 | 0.1 | 0.7 | 12.8 | 0.9 | 11.8 | 8.9 | 0.0 | 41.1 | 43.1 | 43.5 | 44.2 | 35.2 | | 16 | 24 | 8496.0 | 0.1 | 0.9 | 16.1 | 1.1 | 11.7 | 13.7 | 0.0 | 49.2 | 51.3 | 52.5 | 53.4 | 43.6 | | 16 | 32 | 9264.0 | 0.1 | 1.1 | 19.2 | 1.8 | 13.1 | 17.0 | 0.0 | 57.4 | 58.9 | 59.0 | 60.7 | 52.2 | | 16 | 40 | 9808.0 | 0.1 | 1.4 | 21.5 | 1.8 | 13.1 | 23.5 | 0.0 | 66.0 | 66.4 | 66.5 | 66.6 | 61.4 | | 16 | 48 | 10528.0 | 0.1 | 3.2 | 18.6 | 1.6 | 11.6 | 36.3 | 0.0 | 75.6 | 77.1 | 78.3 | 78.6 | 71.3 | | 16 | 56 | 10480.0 | 0.1 | 2.9 | 20.1 | 1.7 | 11.5 | 44.5 | 0.0 | 85.7 | 86.5 | 86.6 | 87.4 | 80.8 | | 16 | 64 | 10352.0 | 0.1 | 2.7 | 21.9 | 2.0 | 11.3 | 51.6 | 0.0 | 94.4 | 95.7 | 96.5 | 97.0 | 89.6 | | 16 | 72 | 10864.0 | 0.1 | 3.3 | 24.1 | 2.2 | 11.6 | 58.0 | 0.0 | 103.6 | 105.6 | 106.1 | 107.1 | 99.4 | | 16 | 80 | 10992.0 | 0.1 | 2.7 | 35.9 | 2.3 | 11.2 | 54.2 | 0.0 | 111.0 | 111.9 | 112.8 | 115.5 | 106.3 | | 16 | 88 | 11648.0 | 0.1 | 3.1 | 46.1 | 2.3 | 11.4 | 53.5 | 0.0 | 120.3 | 121.4 | 122.1 | 125.9 | 116.5 | | 16 | 96 | 11140.9 | 0.1 | 3.7 | 55.3 | 2.6 | 11.3 | 52.6 | 0.0 | 129.6 | 131.3 | 133.1 | 138.9 | 125.6 | | 16 | 104 | 11280.0 | 0.1 | 3.2 | 61.2 | 3.1 | 10.5 | 57.0 | 0.0 | 138.8 | 140.7 | 140.7 | 144.1 | 135.1 | | 16 | 112 | 11824.0 | 0.1 | 3.9 | 65.2 | 3.6 | 11.0 | 60.1 | 0.0 | 147.9 | 149.8 | 150.2 | 154.3 | 143.8 | | 16 | 120 | 10864.0 | 0.1 | 3.6 | 71.2 | 4.6 | 11.2 | 62.9 | 0.0 | 157.6 | 158.7 | 159.4 | 166.0 | 153.5 | | 16 | 128 | 11552.0 | 0.1 | 4.7 | 75.8 | 5.0 | 11.0 | 66.6 | 0.0 | 166.2 | 170.8 | 174.3 | 177.3 | 163.0 | | 16 | 136 | 11152.0 | 0.1 | 5.0 | 81.2 | 12.7 | 9.5 | 66.0 | 0.0 | 177.9 | 181.8 | 187.7 | 194.7 | 174.5 | | 16 | 144 | 11008.0 | 0.1 | 4.1 | 87.5 | 25.8 | 8.6 | 61.2 | 0.0 | 191.5 | 193.4 | 193.6 | 195.5 | 187.3 | | 16 | 152 | 10992.0 | 0.1 | 6.1 | 89.5 | 18.9 | 9.0 | 71.5 | 0.0 | 200.3 | 207.5 | 207.7 | 208.1 | 195.1 | | 16 | 160 | 10656.0 | 0.1 | 5.5 | 91.2 | 30.9 | 8.8 | 68.7 | 0.0 | 210.2 | 215.1 | 215.6 | 221.5 | 205.3 | | 16 | 168 | 11024.0 | 0.1 | 4.8 | 96.1 | 34.5 | 8.6 | 70.2 | 0.0 | 219.3 | 224.1 | 224.8 | 225.3 | 214.3 | | 16 | 176 | 10864.0 | 0.1 | 4.7 | 101.8 | 36.7 | 8.4 | 70.7 | 0.0 | 227.6 | 229.0 | 229.2 | 229.3 | 222.4 | | 16 | 184 | 10896.0 | 0.1 | 5.4 | 107.4 | 38.1 | 8.5 | 73.6 | 0.0 | 237.6 | 242.9 | 243.1 | 244.1 | 233.2 | | 16 | 192 | 10992.0 | 0.1 | 3.2 | 115.2 | 20.8 | 10.0 | 93.2 | 0.0 | 244.9 | 257.2 | 280.7 | 280.9 | 242.5 | | 16 | 200 | 11552.0 | 0.2 | 4.9 | 118.6 | 44.4 | 8.5 | 73.4 | 0.0 | 254.1 | 257.2 | 257.2 | 257.6 | 250.0 | | 16 | 208 | 11236.8 | 0.2 | 1.9 | 124.8 | 21.1 | 10.8 | 101.0 | 0.0 | 263.9 | 281.4 | 287.4 | 288.0 | 259.8 | | 16 | 216 | 11504.0 | 0.2 | 4.4 | 126.3 | 48.3 | 8.4 | 79.7 | 0.0 | 273.0 | 275.6 | 275.9 | 276.0 | 267.3 | | 16 | 224 | 11056.0 | 0.4 | 4.7 | 131.6 | 28.3 | 9.9 | 102.3 | 0.0 | 285.1 | 290.2 | 304.5 | 304.8 | 277.3 | | 16 | 232 | 10528.0 | 0.3 | 4.2 | 169.8 | 36.7 | 9.1 | 73.4 | 0.0 | 295.4 | 317.8 | 318.4 | 319.0 | 293.5 | | 16 | 240 | 10485.5 | 0.2 | 4.6 | 173.9 | 38.0 | 8.4 | 76.7 | 0.0 | 302.6 | 303.9 | 304.2 | 304.7 | 301.8 | | 16 | 248 | 11168.0 | 0.3 | 6.6 | 175.1 | 32.5 | 9.0 | 88.1 | 0.0 | 314.0 | 331.7 | 333.7 | 334.1 | 311.6 | | 16 | 256 | 10384.0 | 0.4 | 3.3 | 184.6 | 40.0 | 8.4 | 82.2 | 0.0 | 318.6 | 321.9 | 322.1 | 322.4 | 318.8 | </details> #### Online: NVIDIA DGX A100 (1x A100 80GB), NVIDIA TensorRT with FP16, Dataset: electricity Our results were obtained using the following configuration: | Parameter Name | Parameter Value | |:-----------------------------|:-----------------------------| | GPU |NVIDIA DGX A100 (1x A100 80GB) | | Backend |NVIDIA TensorRT | | Precision |FP16 | | Model format |NVIDIA TensorRT | | Max batch size |1024 | | Number of model instances |2| | Export Precision | FP32 | | NVIDIA TensorRT Capture CUDA Graph | Disabled | | Dataset | electricity | | Device | gpu | | Request Count | 500 | <table> <tbody> <tr> <td colspan="2" align="center"><img src="./reports/nvidia_dgx_a100_(1x_a100_80gb)_experiment_17_triton_performance_online_17/plots/latency_vs_concurrency.png"></td> </tr> </tbody> </table> <details> <summary>Results Table</summary> | Batch | Concurrency | Inferences/Second | Client Send (ms) | Network+Server Send/Recv (ms) | Server Queue (ms) | Server Compute Input (ms) | Server Compute Infer (ms) | Server Compute Output (ms) | Client Recv (ms) | p50 latency (ms) | p90 latency (ms) | p95 latency (ms) | p99 latency (ms) | avg latency (ms) | |--------:|--------------:|--------------------:|-------------------:|--------------------------------:|--------------------:|----------------------------:|----------------------------:|-----------------------------:|-------------------:|-------------------:|-------------------:|-------------------:|-------------------:|-------------------:| | 16 | 8 | 18304.0 | 0.0 | 0.3 | 3.1 | 0.1 | 3.3 | 0.0 | 0.0 | 6.9 | 7.0 | 7.1 | 7.4 | 6.9 | | 16 | 16 | 20448.0 | 0.0 | 0.5 | 6.6 | 0.1 | 5.2 | 0.0 | 0.0 | 12.5 | 15.5 | 15.6 | 17.1 | 12.4 | | 16 | 24 | 24448.0 | 0.0 | 0.7 | 8.3 | 0.2 | 6.3 | 0.1 | 0.0 | 17.4 | 17.6 | 17.7 | 17.8 | 15.5 | | 16 | 32 | 25312.0 | 0.0 | 0.8 | 10.2 | 0.2 | 8.5 | 0.1 | 0.0 | 22.8 | 24.4 | 24.7 | 24.9 | 19.8 | | 16 | 40 | 23232.0 | 0.0 | 1.2 | 14.2 | 0.4 | 11.3 | 0.1 | 0.0 | 28.7 | 30.3 | 30.4 | 30.5 | 27.1 | | 16 | 48 | 25296.0 | 0.0 | 1.4 | 9.1 | 0.4 | 18.6 | 0.1 | 0.0 | 31.0 | 32.7 | 32.7 | 33.0 | 29.7 | | 16 | 56 | 26560.0 | 0.0 | 1.4 | 16.2 | 0.4 | 14.8 | 0.1 | 0.0 | 34.4 | 40.2 | 40.4 | 40.6 | 32.9 | | 16 | 64 | 26848.0 | 0.0 | 2.0 | 16.6 | 0.4 | 17.8 | 0.1 | 0.0 | 38.6 | 39.0 | 39.1 | 39.2 | 36.9 | | 16 | 72 | 27632.0 | 0.0 | 1.8 | 22.4 | 0.5 | 16.6 | 0.1 | 0.0 | 42.2 | 47.5 | 47.7 | 48.2 | 41.4 | | 16 | 80 | 27808.0 | 0.0 | 1.9 | 25.7 | 0.5 | 16.9 | 0.1 | 0.0 | 47.9 | 48.2 | 48.4 | 48.8 | 45.2 | | 16 | 88 | 29152.0 | 0.0 | 2.5 | 22.8 | 0.6 | 21.1 | 0.1 | 0.0 | 48.7 | 49.4 | 50.4 | 50.6 | 47.2 | | 16 | 96 | 26352.0 | 0.0 | 2.0 | 33.5 | 0.6 | 20.1 | 0.2 | 0.0 | 58.2 | 58.8 | 58.9 | 59.1 | 56.5 | | 16 | 104 | 31824.0 | 0.0 | 2.1 | 27.9 | 0.8 | 20.5 | 0.2 | 0.0 | 53.0 | 53.5 | 53.6 | 53.7 | 51.6 | | 16 | 112 | 34992.0 | 0.0 | 3.2 | 24.8 | 0.9 | 21.8 | 0.2 | 0.0 | 51.8 | 59.5 | 61.5 | 67.9 | 50.9 | | 16 | 120 | 34496.0 | 0.0 | 1.9 | 29.8 | 0.9 | 22.3 | 0.2 | 0.0 | 58.8 | 66.3 | 66.7 | 72.2 | 55.2 | | 16 | 128 | 36784.0 | 0.0 | 2.7 | 30.6 | 1.1 | 20.0 | 0.2 | 0.0 | 54.4 | 59.0 | 59.1 | 59.6 | 54.5 | | 16 | 136 | 36912.0 | 0.0 | 2.3 | 33.8 | 0.9 | 20.4 | 0.2 | 0.0 | 59.0 | 59.3 | 59.5 | 59.6 | 57.7 | | 16 | 144 | 32672.0 | 0.1 | 2.7 | 42.2 | 1.1 | 21.9 | 0.2 | 0.0 | 69.1 | 71.4 | 72.9 | 73.8 | 68.2 | | 16 | 152 | 36576.0 | 0.1 | 1.6 | 37.4 | 1.3 | 23.4 | 0.2 | 0.0 | 66.4 | 70.2 | 77.5 | 78.2 | 63.9 | | 16 | 160 | 37824.0 | 0.1 | 2.2 | 42.0 | 0.9 | 20.9 | 0.2 | 0.0 | 67.1 | 72.1 | 77.5 | 81.7 | 66.3 | | 16 | 168 | 35536.0 | 0.1 | 1.8 | 49.0 | 0.8 | 21.1 | 0.2 | 0.0 | 77.4 | 81.7 | 81.9 | 82.0 | 72.9 | | 16 | 176 | 35488.0 | 0.1 | 2.6 | 51.3 | 0.8 | 21.5 | 0.2 | 0.0 | 81.6 | 82.2 | 82.4 | 90.9 | 76.5 | | 16 | 184 | 33744.0 | 0.1 | 3.7 | 56.2 | 0.8 | 22.4 | 0.2 | 0.0 | 81.8 | 91.8 | 92.1 | 99.1 | 83.3 | | 16 | 192 | 38032.0 | 0.1 | 2.4 | 51.4 | 1.1 | 22.4 | 0.2 | 0.0 | 82.5 | 83.2 | 88.0 | 92.1 | 77.7 | | 16 | 200 | 39632.0 | 0.1 | 2.5 | 49.4 | 0.9 | 23.9 | 0.2 | 0.0 | 78.3 | 83.0 | 83.3 | 90.1 | 76.9 | | 16 | 208 | 34400.0 | 0.1 | 2.1 | 66.7 | 1.1 | 21.9 | 0.2 | 0.0 | 92.5 | 93.1 | 93.3 | 93.5 | 92.2 | | 16 | 216 | 31712.0 | 0.1 | 2.3 | 80.2 | 0.9 | 20.9 | 0.2 | 0.0 | 104.7 | 105.1 | 105.2 | 105.7 | 104.5 | | 16 | 224 | 38016.0 | 0.1 | 2.4 | 65.3 | 1.2 | 21.4 | 0.2 | 0.0 | 90.2 | 93.1 | 93.2 | 93.3 | 90.7 | | 16 | 232 | 37168.0 | 0.1 | 1.8 | 72.2 | 1.1 | 19.7 | 0.2 | 0.0 | 95.2 | 95.8 | 95.9 | 96.0 | 95.1 | | 16 | 240 | 40832.0 | 0.1 | 2.1 | 60.9 | 0.9 | 24.6 | 0.2 | 0.0 | 87.7 | 105.3 | 108.2 | 112.9 | 88.8 | | 16 | 248 | 38272.0 | 0.1 | 2.4 | 71.3 | 1.3 | 23.1 | 0.2 | 0.0 | 99.2 | 102.3 | 110.3 | 110.8 | 98.5 | | 16 | 256 | 33472.0 | 0.1 | 2.4 | 90.1 | 1.1 | 21.9 | 0.2 | 0.0 | 115.9 | 116.9 | 117.4 | 117.8 | 115.9 | </details> #### Online: NVIDIA DGX A100 (1x A100 80GB), NVIDIA TensorRT with FP16, Dataset: traffic Our results were obtained using the following configuration: | Parameter Name | Parameter Value | |:-----------------------------|:-----------------------------| | GPU |NVIDIA DGX A100 (1x A100 80GB) | | Backend |NVIDIA TensorRT | | Precision |FP16 | | Model format |NVIDIA TensorRT | | Max batch size |1024 | | Number of model instances |2| | Export Precision | FP32 | | NVIDIA TensorRT Capture CUDA Graph | Disabled | | Dataset | traffic | | Device | gpu | | Request Count | 500 | <table> <tbody> <tr> <td colspan="2" align="center"><img src="./reports/nvidia_dgx_a100_(1x_a100_80gb)_experiment_18_triton_performance_online_18/plots/latency_vs_concurrency.png"></td> </tr> </tbody> </table> <details> <summary>Results Table</summary> | Batch | Concurrency | Inferences/Second | Client Send (ms) | Network+Server Send/Recv (ms) | Server Queue (ms) | Server Compute Input (ms) | Server Compute Infer (ms) | Server Compute Output (ms) | Client Recv (ms) | p50 latency (ms) | p90 latency (ms) | p95 latency (ms) | p99 latency (ms) | avg latency (ms) | |--------:|--------------:|--------------------:|-------------------:|--------------------------------:|--------------------:|----------------------------:|----------------------------:|-----------------------------:|-------------------:|-------------------:|-------------------:|-------------------:|-------------------:|-------------------:| | 16 | 8 | 18816.0 | 0.0 | 0.2 | 3.1 | 0.1 | 3.3 | 0.0 | 0.0 | 6.8 | 6.8 | 6.9 | 6.9 | 6.8 | | 16 | 16 | 20720.0 | 0.0 | 0.4 | 6.5 | 0.2 | 5.0 | 0.1 | 0.0 | 12.4 | 15.6 | 15.9 | 17.1 | 12.2 | | 16 | 24 | 23424.0 | 0.0 | 0.6 | 8.9 | 0.2 | 6.4 | 0.1 | 0.0 | 17.6 | 19.5 | 19.6 | 19.8 | 16.2 | | 16 | 32 | 23840.0 | 0.0 | 1.2 | 10.4 | 0.4 | 9.2 | 0.1 | 0.0 | 23.1 | 23.4 | 23.5 | 23.6 | 21.3 | | 16 | 40 | 27972.0 | 0.0 | 1.3 | 11.2 | 0.4 | 9.6 | 0.1 | 0.0 | 23.8 | 25.2 | 25.3 | 25.5 | 22.6 | | 16 | 48 | 28704.0 | 0.0 | 1.5 | 13.3 | 0.4 | 11.2 | 0.1 | 0.0 | 28.6 | 29.0 | 29.1 | 30.6 | 26.5 | | 16 | 56 | 26464.0 | 0.0 | 1.8 | 17.3 | 0.7 | 13.1 | 0.1 | 0.0 | 32.6 | 40.4 | 40.6 | 40.8 | 33.1 | | 16 | 64 | 27536.0 | 0.0 | 1.4 | 21.8 | 0.3 | 12.5 | 0.1 | 0.0 | 37.9 | 38.3 | 38.7 | 40.7 | 36.2 | | 16 | 72 | 33680.0 | 0.0 | 1.5 | 13.5 | 0.8 | 17.8 | 0.1 | 0.0 | 35.0 | 38.4 | 38.8 | 40.4 | 33.7 | | 16 | 80 | 27984.0 | 0.0 | 1.6 | 25.5 | 0.5 | 16.6 | 0.1 | 0.0 | 47.7 | 48.2 | 48.3 | 48.6 | 44.4 | | 16 | 88 | 36464.0 | 0.0 | 1.9 | 16.8 | 0.9 | 18.2 | 0.2 | 0.0 | 39.0 | 40.7 | 40.9 | 41.1 | 37.9 | | 16 | 96 | 35792.0 | 0.0 | 1.9 | 21.1 | 0.7 | 17.4 | 0.1 | 0.0 | 42.7 | 43.0 | 43.1 | 43.2 | 41.4 | | 16 | 104 | 35536.0 | 0.0 | 2.1 | 25.9 | 0.7 | 17.6 | 0.1 | 0.0 | 48.0 | 48.2 | 48.4 | 48.6 | 46.4 | | 16 | 112 | 30448.0 | 0.0 | 2.0 | 33.5 | 0.9 | 20.1 | 0.1 | 0.0 | 58.2 | 58.7 | 58.9 | 59.0 | 56.8 | | 16 | 120 | 32480.0 | 0.0 | 2.9 | 32.9 | 0.8 | 20.3 | 0.2 | 0.0 | 58.6 | 59.0 | 59.2 | 60.4 | 57.2 | | 16 | 128 | 34528.0 | 0.0 | 2.7 | 33.1 | 1.0 | 20.4 | 0.2 | 0.0 | 58.7 | 59.1 | 59.2 | 59.3 | 57.4 | | 16 | 136 | 37424.0 | 0.1 | 1.8 | 34.3 | 0.9 | 19.9 | 0.2 | 0.0 | 58.9 | 59.4 | 60.0 | 60.3 | 57.1 | | 16 | 144 | 33552.0 | 0.0 | 2.5 | 41.1 | 0.9 | 21.8 | 0.2 | 0.0 | 68.9 | 69.2 | 69.3 | 69.5 | 66.6 | | 16 | 152 | 35104.0 | 0.1 | 2.2 | 43.0 | 1.0 | 21.4 | 0.2 | 0.0 | 69.2 | 72.3 | 76.7 | 81.6 | 67.7 | | 16 | 160 | 31984.0 | 0.1 | 2.3 | 52.8 | 0.9 | 20.4 | 0.2 | 0.0 | 81.4 | 82.0 | 91.3 | 91.4 | 76.7 | | 16 | 168 | 35456.0 | 0.1 | 2.4 | 49.3 | 0.9 | 20.9 | 0.2 | 0.0 | 71.3 | 91.3 | 91.6 | 92.1 | 73.8 | | 16 | 176 | 33200.0 | 0.1 | 2.2 | 57.0 | 1.0 | 20.8 | 0.2 | 0.0 | 82.1 | 84.1 | 91.7 | 92.2 | 81.2 | | 16 | 184 | 32752.0 | 0.1 | 1.6 | 60.2 | 0.9 | 21.0 | 0.2 | 0.0 | 81.8 | 92.0 | 92.3 | 92.4 | 84.1 | | 16 | 192 | 36192.0 | 0.1 | 2.4 | 54.7 | 1.1 | 23.1 | 0.2 | 0.0 | 84.2 | 92.2 | 92.3 | 93.0 | 81.7 | | 16 | 200 | 37424.0 | 0.1 | 2.8 | 56.8 | 0.9 | 20.8 | 0.2 | 0.0 | 82.0 | 82.2 | 82.3 | 82.4 | 81.6 | | 16 | 208 | 35616.0 | 0.1 | 2.1 | 63.3 | 0.9 | 22.8 | 0.2 | 0.0 | 91.7 | 100.4 | 104.0 | 104.6 | 89.3 | | 16 | 216 | 37200.0 | 0.1 | 2.6 | 63.9 | 1.1 | 21.0 | 0.2 | 0.0 | 89.2 | 89.5 | 89.6 | 89.7 | 88.8 | | 16 | 224 | 32512.0 | 0.1 | 2.1 | 80.5 | 0.9 | 20.7 | 0.2 | 0.0 | 104.6 | 105.0 | 105.1 | 105.6 | 104.5 | | 16 | 232 | 40944.0 | 0.1 | 2.0 | 59.3 | 1.0 | 24.4 | 0.2 | 0.0 | 89.3 | 93.4 | 100.7 | 101.8 | 87.0 | | 16 | 240 | 37952.0 | 0.1 | 2.2 | 74.6 | 1.0 | 17.7 | 0.2 | 0.0 | 94.0 | 101.3 | 101.6 | 103.8 | 95.7 | | 16 | 248 | 37744.0 | 0.2 | 2.2 | 74.6 | 1.0 | 23.0 | 0.2 | 0.0 | 101.8 | 113.0 | 113.4 | 114.6 | 101.1 | | 16 | 256 | 31120.0 | 0.1 | 2.0 | 100.8 | 0.9 | 20.1 | 0.1 | 0.0 | 124.2 | 124.9 | 125.1 | 125.5 | 124.2 | </details> #### Online: NVIDIA DGX A100 (1x A100 80GB), PyTorch with FP16, Dataset: electricity Our results were obtained using the following configuration: | Parameter Name | Parameter Value | |:-----------------------------|:-----------------------------| | GPU |NVIDIA DGX A100 (1x A100 80GB) | | Backend |PyTorch | | Precision |FP16 | | Model format |TorchScript Trace | | Max batch size |1024 | | Number of model instances |2| | Export Precision | FP32 | | Dataset | electricity | | Device | gpu | | Request Count | 500 | <table> <tbody> <tr> <td colspan="2" align="center"><img src="./reports/nvidia_dgx_a100_(1x_a100_80gb)_experiment_27_triton_performance_online_27/plots/latency_vs_concurrency.png"></td> </tr> </tbody> </table> <details> <summary>Results Table</summary> | Batch | Concurrency | Inferences/Second | Client Send (ms) | Network+Server Send/Recv (ms) | Server Queue (ms) | Server Compute Input (ms) | Server Compute Infer (ms) | Server Compute Output (ms) | Client Recv (ms) | p50 latency (ms) | p90 latency (ms) | p95 latency (ms) | p99 latency (ms) | avg latency (ms) | |--------:|--------------:|--------------------:|-------------------:|--------------------------------:|--------------------:|----------------------------:|----------------------------:|-----------------------------:|-------------------:|-------------------:|-------------------:|-------------------:|-------------------:|-------------------:| | 16 | 8 | 8080.0 | 0.0 | 0.2 | 5.0 | 0.2 | 10.1 | 0.1 | 0.0 | 19.3 | 20.4 | 20.5 | 20.9 | 15.6 | | 16 | 16 | 12275.7 | 0.0 | 0.4 | 7.8 | 0.4 | 10.1 | 1.7 | 0.0 | 23.3 | 25.3 | 25.9 | 26.3 | 20.4 | | 16 | 24 | 15072.0 | 0.0 | 0.6 | 10.2 | 0.5 | 10.5 | 2.9 | 0.0 | 27.3 | 28.4 | 28.8 | 29.6 | 24.8 | | 16 | 32 | 17616.0 | 0.0 | 1.0 | 11.7 | 0.6 | 12.0 | 3.1 | 0.0 | 30.9 | 32.0 | 32.3 | 32.6 | 28.5 | | 16 | 40 | 19024.0 | 0.0 | 0.9 | 14.2 | 0.8 | 11.7 | 5.3 | 0.0 | 34.9 | 36.7 | 37.4 | 47.0 | 32.9 | | 16 | 48 | 19312.0 | 0.1 | 2.1 | 12.1 | 1.1 | 11.8 | 12.2 | 0.0 | 39.9 | 46.1 | 49.0 | 54.4 | 39.2 | | 16 | 56 | 20848.0 | 0.0 | 1.4 | 17.9 | 1.1 | 10.0 | 11.1 | 0.0 | 43.6 | 44.9 | 46.0 | 50.8 | 41.6 | | 16 | 64 | 21456.0 | 0.0 | 1.9 | 14.9 | 1.4 | 9.7 | 18.6 | 0.0 | 48.2 | 50.1 | 51.0 | 51.3 | 46.5 | | 16 | 72 | 21600.0 | 0.0 | 4.1 | 19.6 | 1.1 | 10.4 | 16.9 | 0.0 | 53.9 | 54.5 | 54.7 | 55.8 | 52.0 | | 16 | 80 | 22192.0 | 0.1 | 2.1 | 24.1 | 2.2 | 9.5 | 18.0 | 0.0 | 57.9 | 60.0 | 61.5 | 63.2 | 56.0 | | 16 | 88 | 22304.0 | 0.0 | 2.1 | 27.6 | 3.2 | 8.8 | 19.4 | 0.0 | 63.5 | 66.0 | 66.1 | 77.3 | 61.2 | | 16 | 96 | 22176.0 | 0.0 | 2.6 | 29.3 | 4.1 | 8.7 | 21.6 | 0.0 | 68.6 | 71.9 | 76.1 | 79.0 | 66.3 | | 16 | 104 | 22416.0 | 0.0 | 4.4 | 30.2 | 1.6 | 10.8 | 24.1 | 0.0 | 73.4 | 75.0 | 75.9 | 76.5 | 71.1 | | 16 | 112 | 22096.0 | 0.1 | 2.9 | 33.8 | 10.6 | 7.4 | 23.1 | 0.0 | 81.6 | 83.9 | 84.4 | 90.5 | 77.8 | | 16 | 120 | 22320.0 | 0.1 | 3.0 | 34.8 | 10.2 | 7.9 | 25.9 | 0.0 | 85.6 | 90.2 | 102.7 | 116.7 | 81.9 | | 16 | 128 | 22544.0 | 0.1 | 2.9 | 38.9 | 12.9 | 7.1 | 25.4 | 0.0 | 91.8 | 95.3 | 103.6 | 105.4 | 87.3 | | 16 | 136 | 22704.0 | 0.1 | 3.8 | 40.5 | 13.9 | 7.1 | 25.9 | 0.0 | 95.4 | 97.8 | 98.6 | 114.4 | 91.3 | | 16 | 144 | 22224.0 | 0.1 | 2.3 | 42.4 | 18.0 | 6.8 | 26.6 | 0.0 | 101.8 | 107.1 | 108.3 | 108.4 | 96.1 | | 16 | 152 | 22992.0 | 0.1 | 3.3 | 45.4 | 19.0 | 6.8 | 26.6 | 0.0 | 105.8 | 107.6 | 108.0 | 108.8 | 101.2 | | 16 | 160 | 23328.0 | 0.1 | 2.5 | 47.8 | 11.5 | 7.6 | 34.7 | 0.0 | 106.5 | 121.2 | 123.0 | 140.4 | 104.2 | | 16 | 168 | 22448.0 | 0.1 | 3.7 | 50.4 | 15.0 | 8.8 | 32.7 | 0.0 | 112.6 | 123.8 | 126.9 | 131.8 | 110.6 | | 16 | 176 | 22640.0 | 0.1 | 3.6 | 53.3 | 14.9 | 7.7 | 35.1 | 0.0 | 118.0 | 124.1 | 128.9 | 144.0 | 114.7 | | 16 | 184 | 22937.1 | 0.1 | 4.0 | 52.5 | 23.3 | 7.1 | 32.7 | 0.0 | 124.3 | 126.2 | 127.4 | 128.0 | 119.6 | | 16 | 192 | 23768.2 | 0.1 | 3.6 | 56.4 | 20.6 | 7.1 | 36.2 | 0.0 | 127.9 | 130.7 | 136.4 | 139.0 | 124.0 | | 16 | 200 | 23584.0 | 0.1 | 3.9 | 57.8 | 24.4 | 7.2 | 35.5 | 0.0 | 136.1 | 139.0 | 140.3 | 140.7 | 128.7 | | 16 | 208 | 23192.8 | 0.1 | 4.8 | 62.0 | 20.9 | 7.8 | 38.9 | 0.0 | 140.9 | 145.3 | 170.9 | 187.7 | 134.5 | | 16 | 216 | 22873.1 | 0.1 | 3.6 | 80.7 | 17.8 | 7.4 | 32.5 | 0.0 | 145.1 | 152.1 | 158.8 | 159.7 | 142.0 | | 16 | 224 | 23360.0 | 0.1 | 3.7 | 76.7 | 19.9 | 7.4 | 36.1 | 0.0 | 145.4 | 153.1 | 166.4 | 168.8 | 144.0 | | 16 | 232 | 23152.0 | 0.1 | 3.8 | 83.3 | 17.8 | 7.8 | 38.2 | 0.0 | 151.2 | 162.3 | 176.8 | 185.3 | 150.9 | | 16 | 240 | 22384.0 | 0.1 | 4.1 | 88.6 | 21.1 | 7.1 | 34.2 | 0.0 | 157.6 | 161.1 | 166.3 | 170.4 | 155.1 | | 16 | 248 | 22608.0 | 0.2 | 4.5 | 93.4 | 18.5 | 9.3 | 34.8 | 0.0 | 163.3 | 172.8 | 186.2 | 199.5 | 160.8 | | 16 | 256 | 22320.0 | 0.1 | 3.0 | 94.1 | 16.6 | 8.1 | 41.7 | 0.0 | 165.4 | 178.2 | 188.9 | 202.4 | 163.7 | </details> #### Online: NVIDIA DGX A100 (1x A100 80GB), PyTorch with FP16, Dataset: traffic Our results were obtained using the following configuration: | Parameter Name | Parameter Value | |:-----------------------------|:-----------------------------| | GPU |NVIDIA DGX A100 (1x A100 80GB) | | Backend |PyTorch | | Precision |FP16 | | Model format |TorchScript Trace | | Max batch size |1024 | | Number of model instances |2| | Export Precision | FP32 | | Dataset | traffic | | Device | gpu | | Request Count | 500 | <table> <tbody> <tr> <td colspan="2" align="center"><img src="./reports/nvidia_dgx_a100_(1x_a100_80gb)_experiment_28_triton_performance_online_28/plots/latency_vs_concurrency.png"></td> </tr> </tbody> </table> <details> <summary>Results Table</summary> | Batch | Concurrency | Inferences/Second | Client Send (ms) | Network+Server Send/Recv (ms) | Server Queue (ms) | Server Compute Input (ms) | Server Compute Infer (ms) | Server Compute Output (ms) | Client Recv (ms) | p50 latency (ms) | p90 latency (ms) | p95 latency (ms) | p99 latency (ms) | avg latency (ms) | |--------:|--------------:|--------------------:|-------------------:|--------------------------------:|--------------------:|----------------------------:|----------------------------:|-----------------------------:|-------------------:|-------------------:|-------------------:|-------------------:|-------------------:|-------------------:| | 16 | 8 | 8032.0 | 0.0 | 0.3 | 5.0 | 0.2 | 10.0 | 0.1 | 0.0 | 19.3 | 20.2 | 20.4 | 21.0 | 15.6 | | 16 | 16 | 12784.0 | 0.0 | 0.4 | 7.5 | 0.4 | 9.8 | 1.6 | 0.0 | 22.8 | 23.6 | 23.8 | 24.3 | 19.8 | | 16 | 24 | 15888.0 | 0.0 | 0.7 | 9.3 | 0.5 | 9.8 | 3.6 | 0.0 | 26.5 | 27.3 | 27.5 | 27.7 | 23.9 | | 16 | 32 | 17952.0 | 0.0 | 0.7 | 10.8 | 0.6 | 9.8 | 6.1 | 0.0 | 30.5 | 31.1 | 31.4 | 31.6 | 28.0 | | 16 | 40 | 19376.0 | 0.0 | 1.0 | 12.6 | 0.7 | 9.7 | 8.1 | 0.0 | 34.5 | 35.3 | 35.5 | 35.7 | 32.2 | | 16 | 48 | 20528.0 | 0.0 | 1.4 | 15.9 | 0.9 | 9.6 | 8.6 | 0.0 | 38.7 | 39.5 | 39.8 | 40.1 | 36.4 | | 16 | 56 | 20848.0 | 0.0 | 1.2 | 18.5 | 0.9 | 10.3 | 10.7 | 0.0 | 43.8 | 45.2 | 45.6 | 46.3 | 41.7 | | 16 | 64 | 21968.0 | 0.0 | 1.6 | 20.6 | 0.9 | 10.2 | 12.5 | 0.0 | 48.0 | 48.7 | 48.9 | 49.3 | 45.9 | | 16 | 72 | 22144.0 | 0.1 | 1.7 | 20.8 | 1.2 | 9.8 | 16.7 | 0.0 | 52.5 | 53.6 | 54.1 | 54.7 | 50.3 | | 16 | 80 | 22656.0 | 0.0 | 2.2 | 23.2 | 2.6 | 9.0 | 18.4 | 0.0 | 57.6 | 59.4 | 59.8 | 62.7 | 55.5 | | 16 | 88 | 23208.8 | 0.0 | 2.6 | 26.3 | 2.0 | 9.9 | 18.7 | 0.0 | 61.5 | 62.6 | 62.9 | 68.4 | 59.5 | | 16 | 96 | 22464.0 | 0.0 | 2.6 | 27.4 | 2.6 | 9.0 | 23.7 | 0.0 | 67.3 | 69.6 | 73.2 | 79.3 | 65.4 | | 16 | 104 | 22752.0 | 0.0 | 2.9 | 31.8 | 3.7 | 8.7 | 22.9 | 0.0 | 72.4 | 76.1 | 78.1 | 85.2 | 70.0 | | 16 | 112 | 23352.6 | 0.1 | 3.6 | 31.8 | 1.5 | 10.6 | 27.3 | 0.0 | 76.3 | 80.4 | 82.2 | 87.4 | 74.9 | | 16 | 120 | 22592.0 | 0.1 | 3.7 | 34.0 | 7.5 | 8.1 | 28.6 | 0.0 | 83.8 | 86.1 | 88.0 | 107.9 | 81.9 | | 16 | 128 | 22288.0 | 0.1 | 3.7 | 38.1 | 8.8 | 8.1 | 26.6 | 0.0 | 87.9 | 99.0 | 100.6 | 113.3 | 85.4 | | 16 | 136 | 23440.0 | 0.1 | 3.1 | 38.2 | 16.5 | 6.7 | 25.4 | 0.0 | 94.0 | 99.6 | 100.7 | 102.5 | 90.1 | | 16 | 144 | 22864.0 | 0.1 | 2.8 | 43.7 | 14.4 | 7.3 | 27.5 | 0.0 | 99.4 | 102.7 | 104.8 | 121.1 | 95.7 | | 16 | 152 | 23224.8 | 0.1 | 3.9 | 45.5 | 11.7 | 7.6 | 31.4 | 0.0 | 103.0 | 108.4 | 116.6 | 128.1 | 100.2 | | 16 | 160 | 22496.0 | 0.1 | 4.3 | 46.8 | 13.1 | 7.7 | 34.3 | 0.0 | 110.5 | 115.9 | 125.3 | 136.9 | 106.2 | | 16 | 168 | 23760.0 | 0.1 | 3.4 | 49.5 | 18.7 | 7.2 | 29.3 | 0.0 | 111.9 | 113.3 | 113.8 | 135.5 | 108.1 | | 16 | 176 | 23328.0 | 0.1 | 3.9 | 51.5 | 21.3 | 7.6 | 29.1 | 0.0 | 116.8 | 120.4 | 121.2 | 124.7 | 113.5 | | 16 | 184 | 23440.0 | 0.1 | 4.1 | 52.6 | 21.0 | 6.9 | 34.0 | 0.0 | 123.0 | 127.5 | 128.1 | 129.3 | 118.6 | | 16 | 192 | 23728.0 | 0.1 | 3.7 | 56.8 | 19.4 | 7.0 | 35.9 | 0.0 | 122.8 | 123.1 | 123.2 | 123.3 | 122.8 | | 16 | 200 | 23808.0 | 0.1 | 4.8 | 57.8 | 23.0 | 7.0 | 33.6 | 0.0 | 128.3 | 132.6 | 133.2 | 136.8 | 126.3 | | 16 | 208 | 23856.0 | 0.1 | 4.2 | 59.0 | 25.7 | 7.2 | 35.1 | 0.0 | 138.1 | 140.9 | 141.2 | 141.6 | 131.2 | | 16 | 216 | 23200.0 | 0.1 | 3.6 | 64.5 | 23.8 | 6.9 | 36.7 | 0.0 | 135.5 | 136.1 | 136.6 | 136.7 | 135.6 | | 16 | 224 | 24384.0 | 0.1 | 4.8 | 67.1 | 24.7 | 6.7 | 36.5 | 0.0 | 139.9 | 140.9 | 141.1 | 142.8 | 139.9 | | 16 | 232 | 23040.0 | 0.1 | 4.1 | 83.9 | 20.1 | 7.0 | 33.5 | 0.0 | 152.9 | 158.9 | 168.2 | 169.6 | 148.6 | | 16 | 240 | 23496.5 | 0.1 | 3.1 | 87.0 | 20.9 | 7.1 | 35.2 | 0.0 | 156.1 | 159.9 | 168.7 | 171.1 | 153.3 | | 16 | 248 | 23072.0 | 0.1 | 4.1 | 95.5 | 13.4 | 8.5 | 38.0 | 0.0 | 161.2 | 178.6 | 179.7 | 193.0 | 159.5 | | 16 | 256 | 21952.0 | 0.1 | 4.0 | 97.0 | 15.3 | 7.7 | 38.3 | 0.0 | 164.7 | 186.0 | 192.8 | 194.8 | 162.4 | </details> #### Online: NVIDIA T4, NVIDIA TensorRT with FP16, Dataset: electricity Our results were obtained using the following configuration: | Parameter Name | Parameter Value | |:-----------------------------|:-----------------------------| | GPU |NVIDIA T4 | | Backend |NVIDIA TensorRT | | Precision |FP16 | | Model format |NVIDIA TensorRT | | Max batch size |1024 | | Number of model instances |2| | Export Precision | FP32 | | NVIDIA TensorRT Capture CUDA Graph | Disabled | | Dataset | electricity | | Device | gpu | | Request Count | 500 | <table> <tbody> <tr> <td colspan="2" align="center"><img src="./reports/nvidia_t4_experiment_17_triton_performance_online_17/plots/latency_vs_concurrency.png"></td> </tr> </tbody> </table> <details> <summary>Results Table</summary> | Batch | Concurrency | Inferences/Second | Client Send (ms) | Network+Server Send/Recv (ms) | Server Queue (ms) | Server Compute Input (ms) | Server Compute Infer (ms) | Server Compute Output (ms) | Client Recv (ms) | p50 latency (ms) | p90 latency (ms) | p95 latency (ms) | p99 latency (ms) | avg latency (ms) | |--------:|--------------:|--------------------:|-------------------:|--------------------------------:|--------------------:|----------------------------:|----------------------------:|-----------------------------:|-------------------:|-------------------:|-------------------:|-------------------:|-------------------:|-------------------:| | 16 | 8 | 10048.0 | 0.1 | 0.7 | 5.3 | 0.1 | 6.3 | 0.0 | 0.0 | 12.6 | 12.7 | 12.7 | 12.8 | 12.6 | | 16 | 16 | 8464.0 | 0.1 | 1.0 | 15.6 | 0.2 | 13.0 | 0.0 | 0.0 | 30.5 | 41.0 | 41.5 | 41.7 | 29.9 | | 16 | 24 | 9472.0 | 0.1 | 1.4 | 19.2 | 0.2 | 17.9 | 0.0 | 0.0 | 41.4 | 57.5 | 57.8 | 62.8 | 38.9 | | 16 | 32 | 9568.0 | 0.1 | 2.0 | 20.2 | 0.3 | 30.3 | 0.0 | 0.0 | 57.4 | 61.5 | 61.6 | 61.7 | 53.1 | | 16 | 40 | 9616.0 | 0.1 | 2.4 | 31.6 | 0.3 | 29.4 | 0.0 | 0.0 | 70.4 | 71.3 | 71.6 | 72.0 | 63.9 | | 16 | 48 | 9872.0 | 0.1 | 3.8 | 34.9 | 0.5 | 35.9 | 0.1 | 0.0 | 71.1 | 108.0 | 108.8 | 109.3 | 75.3 | | 16 | 56 | 9024.0 | 0.1 | 2.8 | 54.7 | 0.3 | 36.5 | 0.0 | 0.0 | 100.7 | 101.2 | 101.7 | 101.8 | 94.5 | | 16 | 64 | 9536.0 | 0.1 | 4.1 | 37.6 | 0.6 | 61.2 | 0.1 | 0.0 | 108.4 | 109.0 | 109.3 | 109.5 | 103.7 | | 16 | 72 | 8016.0 | 0.1 | 3.7 | 74.4 | 0.5 | 53.0 | 0.0 | 0.0 | 137.2 | 138.0 | 138.3 | 138.5 | 131.7 | | 16 | 80 | 9328.0 | 0.1 | 3.8 | 71.0 | 0.6 | 57.2 | 0.1 | 0.0 | 137.5 | 138.6 | 139.6 | 139.8 | 132.7 | | 16 | 88 | 8240.0 | 0.1 | 3.0 | 85.8 | 0.6 | 61.5 | 0.0 | 0.0 | 158.5 | 175.1 | 176.1 | 176.9 | 151.0 | | 16 | 96 | 9504.0 | 0.1 | 3.8 | 91.9 | 0.6 | 57.2 | 0.0 | 0.0 | 158.4 | 159.8 | 160.6 | 196.6 | 153.7 | | 16 | 104 | 9526.5 | 0.2 | 3.6 | 96.2 | 0.8 | 69.6 | 0.0 | 0.0 | 175.4 | 176.3 | 176.3 | 176.6 | 170.4 | | 16 | 112 | 9424.0 | 0.2 | 3.8 | 94.8 | 0.9 | 70.9 | 0.1 | 0.0 | 175.9 | 176.9 | 177.0 | 177.1 | 170.6 | | 16 | 120 | 9280.0 | 0.2 | 4.0 | 116.7 | 0.9 | 69.5 | 0.1 | 0.0 | 196.2 | 196.8 | 196.9 | 197.2 | 191.4 | | 16 | 128 | 9552.0 | 0.2 | 4.3 | 116.8 | 0.9 | 69.3 | 0.1 | 0.0 | 196.4 | 197.2 | 197.4 | 197.6 | 191.5 | | 16 | 136 | 10165.8 | 0.3 | 3.3 | 117.3 | 1.0 | 69.4 | 0.1 | 0.0 | 196.9 | 197.4 | 197.6 | 197.8 | 191.4 | | 16 | 144 | 10400.0 | 0.3 | 4.6 | 115.3 | 1.0 | 70.9 | 0.1 | 0.0 | 196.6 | 197.2 | 197.4 | 197.7 | 192.1 | | 16 | 152 | 9350.6 | 0.3 | 5.1 | 146.4 | 1.0 | 77.2 | 0.1 | 0.0 | 234.6 | 235.3 | 235.6 | 236.0 | 230.1 | | 16 | 160 | 9744.0 | 0.3 | 4.8 | 145.9 | 1.1 | 77.0 | 0.1 | 0.0 | 234.1 | 234.9 | 235.3 | 235.6 | 229.2 | | 16 | 168 | 7520.0 | 0.5 | 2.7 | 220.8 | 0.9 | 77.2 | 0.1 | 0.0 | 311.0 | 312.4 | 312.5 | 312.8 | 301.9 | | 16 | 176 | 7880.1 | 0.5 | 4.0 | 227.3 | 0.9 | 77.0 | 0.1 | 0.0 | 311.6 | 312.7 | 312.8 | 313.1 | 309.8 | | 16 | 184 | 9760.0 | 0.8 | 5.3 | 183.3 | 1.0 | 73.3 | 0.1 | 0.0 | 256.0 | 275.9 | 276.2 | 276.4 | 263.9 | | 16 | 192 | 9312.0 | 0.8 | 3.8 | 197.8 | 0.9 | 70.4 | 0.1 | 0.0 | 275.1 | 275.9 | 276.0 | 276.5 | 273.9 | | 16 | 200 | 8880.0 | 0.9 | 3.5 | 229.1 | 1.0 | 77.2 | 0.1 | 0.0 | 312.8 | 313.9 | 314.0 | 314.2 | 311.7 | | 16 | 208 | 10992.0 | 1.1 | 3.4 | 188.8 | 1.1 | 71.6 | 0.2 | 0.0 | 266.3 | 266.9 | 267.1 | 267.5 | 266.1 | | 16 | 216 | 9600.0 | 0.8 | 4.8 | 228.0 | 1.1 | 77.2 | 0.1 | 0.0 | 313.0 | 314.2 | 314.5 | 315.4 | 311.9 | | 16 | 224 | 9776.0 | 1.1 | 3.8 | 228.5 | 1.1 | 77.2 | 0.1 | 0.0 | 313.0 | 313.7 | 313.8 | 314.0 | 311.9 | | 16 | 232 | 10928.0 | 1.1 | 3.5 | 220.3 | 1.1 | 69.4 | 0.1 | 0.0 | 296.0 | 296.9 | 297.0 | 297.4 | 295.5 | | 16 | 240 | 10752.0 | 1.3 | 4.2 | 228.7 | 1.1 | 77.2 | 0.2 | 0.0 | 313.3 | 314.0 | 314.1 | 314.3 | 312.8 | | 16 | 248 | 9878.1 | 1.4 | 5.1 | 249.7 | 1.2 | 74.8 | 0.2 | 0.0 | 332.9 | 334.1 | 334.3 | 334.6 | 332.4 | | 16 | 256 | 10368.0 | 1.2 | 4.7 | 251.1 | 1.1 | 74.9 | 0.2 | 0.0 | 333.6 | 334.4 | 334.6 | 335.3 | 333.2 | </details> #### Online: NVIDIA T4, NVIDIA TensorRT with FP16, Dataset: traffic Our results were obtained using the following configuration: | Parameter Name | Parameter Value | |:-----------------------------|:-----------------------------| | GPU |NVIDIA T4 | | Backend |NVIDIA TensorRT | | Precision |FP16 | | Model format |NVIDIA TensorRT | | Max batch size |1024 | | Number of model instances |2| | Export Precision | FP32 | | NVIDIA TensorRT Capture CUDA Graph | Disabled | | Dataset | traffic | | Device | gpu | | Request Count | 500 | <table> <tbody> <tr> <td colspan="2" align="center"><img src="./reports/nvidia_t4_experiment_18_triton_performance_online_18/plots/latency_vs_concurrency.png"></td> </tr> </tbody> </table> <details> <summary>Results Table</summary> | Batch | Concurrency | Inferences/Second | Client Send (ms) | Network+Server Send/Recv (ms) | Server Queue (ms) | Server Compute Input (ms) | Server Compute Infer (ms) | Server Compute Output (ms) | Client Recv (ms) | p50 latency (ms) | p90 latency (ms) | p95 latency (ms) | p99 latency (ms) | avg latency (ms) | |--------:|--------------:|--------------------:|-------------------:|--------------------------------:|--------------------:|----------------------------:|----------------------------:|-----------------------------:|-------------------:|-------------------:|-------------------:|-------------------:|-------------------:|-------------------:| | 16 | 8 | 10176.0 | 0.1 | 0.7 | 5.2 | 0.1 | 6.2 | 0.0 | 0.0 | 12.4 | 12.5 | 12.6 | 12.6 | 12.4 | | 16 | 16 | 8880.0 | 0.1 | 0.9 | 14.6 | 0.1 | 12.4 | 0.0 | 0.0 | 28.6 | 37.0 | 41.6 | 41.9 | 28.3 | | 16 | 24 | 9520.0 | 0.1 | 1.3 | 19.9 | 0.2 | 17.8 | 0.0 | 0.0 | 41.6 | 50.9 | 57.3 | 61.9 | 39.4 | | 16 | 32 | 9152.0 | 0.1 | 2.1 | 21.0 | 0.3 | 30.8 | 0.0 | 0.0 | 57.9 | 62.3 | 63.1 | 65.2 | 54.3 | | 16 | 40 | 9712.0 | 0.1 | 2.7 | 30.0 | 0.3 | 31.6 | 0.0 | 0.0 | 70.7 | 71.2 | 71.4 | 71.6 | 64.8 | | 16 | 48 | 8000.0 | 0.1 | 3.4 | 28.3 | 0.4 | 61.5 | 0.1 | 0.0 | 95.8 | 104.0 | 104.1 | 104.2 | 93.7 | | 16 | 56 | 9376.0 | 0.1 | 3.9 | 24.7 | 0.6 | 64.1 | 0.1 | 0.0 | 95.4 | 104.5 | 105.3 | 106.0 | 93.4 | | 16 | 64 | 8192.0 | 0.1 | 3.4 | 55.8 | 0.5 | 58.8 | 0.0 | 0.0 | 124.4 | 124.7 | 125.2 | 125.3 | 118.7 | | 16 | 72 | 8432.0 | 0.1 | 2.2 | 73.0 | 0.5 | 51.0 | 0.0 | 0.0 | 137.8 | 138.8 | 139.1 | 139.4 | 126.9 | | 16 | 80 | 8944.0 | 0.1 | 4.3 | 71.9 | 0.5 | 55.9 | 0.1 | 0.0 | 137.2 | 138.6 | 138.8 | 139.0 | 132.7 | | 16 | 88 | 7936.0 | 0.1 | 3.0 | 93.5 | 0.7 | 72.3 | 0.1 | 0.0 | 175.2 | 176.1 | 176.3 | 176.4 | 169.6 | | 16 | 96 | 9152.0 | 0.2 | 3.0 | 92.8 | 0.7 | 56.4 | 0.1 | 0.0 | 159.0 | 159.4 | 159.5 | 159.8 | 153.1 | | 16 | 104 | 9510.5 | 0.1 | 3.5 | 93.2 | 0.7 | 57.0 | 0.1 | 0.0 | 159.3 | 159.9 | 159.9 | 160.1 | 154.6 | | 16 | 112 | 10709.3 | 0.2 | 2.8 | 91.4 | 0.9 | 61.3 | 0.1 | 0.0 | 159.2 | 160.2 | 160.4 | 196.7 | 156.7 | | 16 | 120 | 8848.0 | 0.2 | 3.5 | 116.2 | 0.9 | 70.3 | 0.1 | 0.0 | 196.7 | 198.1 | 198.5 | 199.3 | 191.2 | | 16 | 128 | 9472.0 | 0.2 | 3.8 | 118.7 | 0.8 | 68.4 | 0.1 | 0.0 | 196.6 | 197.2 | 197.3 | 197.4 | 192.0 | | 16 | 136 | 10208.0 | 0.2 | 4.1 | 117.3 | 0.9 | 69.6 | 0.1 | 0.0 | 196.9 | 197.8 | 198.1 | 199.0 | 192.2 | | 16 | 144 | 8599.4 | 0.2 | 4.2 | 146.6 | 0.9 | 77.2 | 0.1 | 0.0 | 234.1 | 235.2 | 235.7 | 236.0 | 229.3 | | 16 | 152 | 9110.9 | 0.3 | 4.2 | 146.5 | 1.0 | 77.3 | 0.1 | 0.0 | 235.0 | 235.6 | 235.7 | 236.0 | 229.4 | | 16 | 160 | 7680.0 | 0.4 | 3.2 | 196.0 | 0.8 | 72.5 | 0.1 | 0.0 | 274.5 | 275.2 | 275.6 | 276.1 | 273.1 | | 16 | 168 | 9968.0 | 0.5 | 4.3 | 147.3 | 1.2 | 77.3 | 0.1 | 0.0 | 234.8 | 236.1 | 236.3 | 236.7 | 230.7 | | 16 | 176 | 9248.0 | 0.6 | 3.4 | 197.3 | 0.9 | 71.7 | 0.1 | 0.0 | 275.6 | 276.8 | 276.9 | 277.1 | 274.0 | | 16 | 184 | 8871.1 | 0.6 | 4.2 | 203.9 | 1.1 | 70.7 | 0.1 | 0.0 | 275.5 | 313.3 | 313.9 | 314.6 | 280.6 | | 16 | 192 | 11252.7 | 0.5 | 5.4 | 151.3 | 1.5 | 77.1 | 0.1 | 0.0 | 235.9 | 237.3 | 237.6 | 238.7 | 235.9 | | 16 | 200 | 10896.0 | 0.8 | 3.9 | 175.2 | 1.2 | 73.2 | 0.2 | 0.0 | 255.9 | 256.5 | 256.6 | 257.4 | 254.4 | | 16 | 208 | 11040.0 | 1.1 | 3.5 | 195.6 | 1.1 | 73.1 | 0.1 | 0.0 | 275.9 | 276.8 | 276.9 | 277.1 | 274.6 | | 16 | 216 | 10384.0 | 1.1 | 4.0 | 215.2 | 1.1 | 71.2 | 0.1 | 0.0 | 295.2 | 296.3 | 296.7 | 297.4 | 292.8 | | 16 | 224 | 10752.0 | 0.9 | 4.5 | 224.8 | 1.4 | 70.8 | 0.1 | 0.0 | 297.4 | 317.0 | 317.4 | 318.4 | 302.5 | | 16 | 232 | 10144.0 | 1.0 | 3.7 | 244.1 | 1.0 | 75.1 | 0.2 | 0.0 | 324.5 | 332.0 | 332.9 | 333.0 | 325.0 | | 16 | 240 | 10560.0 | 1.2 | 4.4 | 228.1 | 1.1 | 77.3 | 0.2 | 0.0 | 313.6 | 314.8 | 315.0 | 315.2 | 312.3 | | 16 | 248 | 10896.0 | 1.5 | 4.0 | 245.3 | 1.2 | 75.3 | 0.2 | 0.0 | 326.0 | 334.1 | 334.5 | 335.4 | 327.5 | | 16 | 256 | 11264.0 | 1.5 | 4.3 | 230.6 | 1.7 | 77.0 | 0.2 | 0.0 | 315.4 | 316.4 | 316.6 | 317.0 | 315.4 | </details> #### Online: NVIDIA T4, PyTorch with FP16, Dataset: electricity Our results were obtained using the following configuration: | Parameter Name | Parameter Value | |:-----------------------------|:-----------------------------| | GPU |NVIDIA T4 | | Backend |PyTorch | | Precision |FP16 | | Model format |TorchScript Trace | | Max batch size |1024 | | Number of model instances |2| | Export Precision | FP32 | | Dataset | electricity | | Device | gpu | | Request Count | 500 | <table> <tbody> <tr> <td colspan="2" align="center"><img src="./reports/nvidia_t4_experiment_27_triton_performance_online_27/plots/latency_vs_concurrency.png"></td> </tr> </tbody> </table> <details> <summary>Results Table</summary> | Batch | Concurrency | Inferences/Second | Client Send (ms) | Network+Server Send/Recv (ms) | Server Queue (ms) | Server Compute Input (ms) | Server Compute Infer (ms) | Server Compute Output (ms) | Client Recv (ms) | p50 latency (ms) | p90 latency (ms) | p95 latency (ms) | p99 latency (ms) | avg latency (ms) | |--------:|--------------:|--------------------:|-------------------:|--------------------------------:|--------------------:|----------------------------:|----------------------------:|-----------------------------:|-------------------:|-------------------:|-------------------:|-------------------:|-------------------:|-------------------:| | 16 | 8 | 3264.0 | 0.1 | 0.6 | 13.9 | 0.8 | 8.9 | 14.2 | 0.0 | 43.8 | 47.8 | 50.1 | 52.1 | 38.5 | | 16 | 16 | 3669.3 | 0.1 | 1.0 | 26.2 | 2.0 | 9.1 | 30.3 | 0.0 | 76.8 | 82.8 | 84.7 | 86.7 | 68.7 | | 16 | 24 | 3760.0 | 0.1 | 1.6 | 37.0 | 2.7 | 9.1 | 50.0 | 0.0 | 111.8 | 114.0 | 114.5 | 117.8 | 100.4 | | 16 | 32 | 3818.7 | 0.1 | 1.3 | 58.1 | 1.9 | 9.0 | 61.7 | 0.0 | 143.8 | 146.6 | 148.1 | 150.5 | 132.2 | | 16 | 40 | 3801.4 | 0.1 | 3.0 | 69.5 | 2.0 | 8.9 | 80.0 | 0.0 | 175.5 | 180.4 | 180.8 | 181.7 | 163.4 | | 16 | 48 | 3822.7 | 0.1 | 3.4 | 77.8 | 6.0 | 9.1 | 98.1 | 0.0 | 205.7 | 209.7 | 211.7 | 216.0 | 194.6 | | 16 | 56 | 3785.4 | 0.1 | 4.7 | 77.8 | 4.2 | 8.8 | 128.9 | 0.0 | 236.4 | 239.9 | 241.8 | 242.0 | 224.5 | | 16 | 64 | 3669.3 | 0.1 | 4.8 | 65.2 | 10.4 | 8.4 | 169.2 | 0.0 | 270.8 | 277.5 | 278.0 | 278.2 | 258.2 | | 16 | 72 | 3769.4 | 0.1 | 4.6 | 129.8 | 5.5 | 8.2 | 140.6 | 0.0 | 300.9 | 305.2 | 306.5 | 306.8 | 288.8 | | 16 | 80 | 3528.0 | 0.1 | 4.7 | 102.8 | 15.8 | 7.3 | 190.4 | 0.0 | 335.5 | 342.8 | 342.9 | 384.7 | 321.2 | | 16 | 88 | 3594.7 | 0.1 | 4.0 | 158.6 | 15.5 | 9.1 | 163.3 | 0.0 | 363.4 | 369.4 | 370.6 | 420.0 | 350.6 | | 16 | 96 | 3700.1 | 0.1 | 4.4 | 187.4 | 22.6 | 8.4 | 159.2 | 0.0 | 394.9 | 397.8 | 398.7 | 412.2 | 382.2 | | 16 | 104 | 3710.8 | 0.1 | 6.4 | 191.4 | 31.9 | 8.7 | 178.8 | 0.0 | 430.1 | 432.2 | 463.7 | 465.9 | 417.4 | | 16 | 112 | 3680.0 | 0.1 | 6.1 | 213.8 | 33.0 | 8.5 | 187.7 | 0.0 | 461.4 | 464.6 | 465.3 | 465.5 | 449.4 | | 16 | 120 | 3616.0 | 0.1 | 7.5 | 158.8 | 27.8 | 7.7 | 274.8 | 0.0 | 489.4 | 493.1 | 500.8 | 501.0 | 476.8 | | 16 | 128 | 3514.7 | 0.2 | 5.2 | 188.4 | 83.0 | 8.0 | 223.8 | 0.0 | 525.3 | 531.1 | 531.6 | 573.8 | 508.6 | | 16 | 136 | 3716.1 | 0.2 | 5.4 | 243.3 | 67.8 | 8.0 | 210.6 | 0.0 | 547.8 | 551.0 | 551.6 | 552.1 | 535.2 | | 16 | 144 | 3168.0 | 0.2 | 3.6 | 263.3 | 76.0 | 8.6 | 213.1 | 0.0 | 583.8 | 720.5 | 720.8 | 721.4 | 564.8 | | 16 | 152 | 3642.7 | 0.2 | 6.6 | 232.6 | 57.1 | 7.4 | 292.4 | 0.0 | 607.9 | 609.5 | 610.0 | 619.0 | 596.4 | | 16 | 160 | 3512.0 | 0.3 | 3.6 | 280.5 | 119.6 | 7.3 | 221.4 | 0.0 | 647.3 | 650.8 | 651.4 | 666.6 | 632.7 | | 16 | 168 | 3206.4 | 0.2 | 6.4 | 283.2 | 116.6 | 7.9 | 243.7 | 0.0 | 669.6 | 670.4 | 670.5 | 670.7 | 657.9 | | 16 | 176 | 3550.8 | 0.4 | 6.3 | 334.8 | 109.5 | 7.0 | 239.9 | 0.0 | 710.4 | 714.1 | 720.1 | 722.4 | 697.9 | | 16 | 184 | 3462.3 | 0.4 | 5.4 | 334.5 | 141.1 | 6.6 | 235.4 | 0.0 | 739.5 | 741.4 | 755.4 | 755.7 | 723.5 | | 16 | 192 | 3232.0 | 0.4 | 6.8 | 350.1 | 135.7 | 7.2 | 255.5 | 0.0 | 769.6 | 774.4 | 786.3 | 786.6 | 755.7 | | 16 | 200 | 3578.7 | 0.5 | 5.9 | 366.7 | 157.9 | 6.5 | 250.9 | 0.0 | 801.4 | 807.8 | 808.4 | 808.8 | 788.3 | | 16 | 208 | 3384.0 | 0.4 | 5.7 | 384.7 | 134.6 | 7.5 | 283.0 | 0.0 | 827.6 | 832.8 | 836.8 | 837.3 | 816.0 | | 16 | 216 | 2952.0 | 0.7 | 5.4 | 419.1 | 145.7 | 6.8 | 265.2 | 0.0 | 844.8 | 851.7 | 851.8 | 852.1 | 842.9 | | 16 | 224 | 3198.4 | 0.8 | 1.5 | 491.9 | 138.6 | 6.9 | 231.5 | 0.0 | 882.4 | 900.1 | 901.0 | 904.3 | 871.1 | | 16 | 232 | 3370.7 | 1.1 | 6.2 | 436.3 | 169.3 | 7.0 | 281.1 | 0.0 | 900.1 | 906.2 | 906.4 | 906.6 | 900.9 | | 16 | 240 | 3514.7 | 1.2 | 4.7 | 457.9 | 188.6 | 7.5 | 278.4 | 0.0 | 941.9 | 947.9 | 948.0 | 948.2 | 938.4 | | 16 | 248 | 3294.9 | 1.1 | 6.2 | 572.9 | 132.5 | 8.2 | 259.2 | 0.0 | 981.8 | 987.8 | 990.1 | 990.2 | 980.0 | | 16 | 256 | 3144.0 | 0.7 | 8.5 | 602.8 | 120.8 | 7.3 | 269.7 | 0.0 | 1010.5 | 1247.8 | 1248.0 | 1248.8 | 1009.9 | </details> #### Online: NVIDIA T4, PyTorch with FP16, Dataset: traffic Our results were obtained using the following configuration: | Parameter Name | Parameter Value | |:-----------------------------|:-----------------------------| | GPU |NVIDIA T4 | | Backend |PyTorch | | Precision |FP16 | | Model format |TorchScript Trace | | Max batch size |1024 | | Number of model instances |2| | Export Precision | FP32 | | Dataset | traffic | | Device | gpu | | Request Count | 500 | <table> <tbody> <tr> <td colspan="2" align="center"><img src="./reports/nvidia_t4_experiment_28_triton_performance_online_28/plots/latency_vs_concurrency.png"></td> </tr> </tbody> </table> <details> <summary>Results Table</summary> | Batch | Concurrency | Inferences/Second | Client Send (ms) | Network+Server Send/Recv (ms) | Server Queue (ms) | Server Compute Input (ms) | Server Compute Infer (ms) | Server Compute Output (ms) | Client Recv (ms) | p50 latency (ms) | p90 latency (ms) | p95 latency (ms) | p99 latency (ms) | avg latency (ms) | |--------:|--------------:|--------------------:|-------------------:|--------------------------------:|--------------------:|----------------------------:|----------------------------:|-----------------------------:|-------------------:|-------------------:|-------------------:|-------------------:|-------------------:|-------------------:| | 16 | 8 | 3486.8 | 0.1 | 0.8 | 10.6 | 1.6 | 10.0 | 13.2 | 0.0 | 43.3 | 47.9 | 48.4 | 49.4 | 36.5 | | 16 | 16 | 3668.1 | 0.1 | 0.9 | 25.4 | 2.2 | 9.1 | 30.4 | 0.0 | 77.2 | 82.6 | 83.9 | 87.3 | 68.0 | | 16 | 24 | 3764.1 | 0.1 | 1.4 | 40.4 | 2.2 | 9.1 | 46.5 | 0.0 | 111.1 | 115.9 | 116.9 | 117.6 | 99.7 | | 16 | 32 | 3822.7 | 0.1 | 2.2 | 56.6 | 1.8 | 8.9 | 61.3 | 0.0 | 142.5 | 145.5 | 147.1 | 151.0 | 130.9 | | 16 | 40 | 3785.4 | 0.1 | 2.6 | 69.6 | 1.9 | 8.9 | 79.1 | 0.0 | 174.4 | 179.3 | 180.0 | 181.6 | 162.2 | | 16 | 48 | 3854.7 | 0.1 | 4.3 | 67.3 | 4.2 | 8.9 | 107.5 | 0.0 | 205.1 | 209.3 | 209.5 | 212.6 | 192.4 | | 16 | 56 | 3786.7 | 0.1 | 3.2 | 99.9 | 5.0 | 8.5 | 108.0 | 0.0 | 236.7 | 240.9 | 242.2 | 242.8 | 224.7 | | 16 | 64 | 3882.7 | 0.1 | 6.3 | 65.8 | 8.2 | 8.3 | 168.3 | 0.0 | 269.1 | 275.5 | 276.0 | 378.1 | 257.1 | | 16 | 72 | 3690.7 | 0.1 | 6.5 | 103.0 | 11.5 | 8.0 | 159.3 | 0.0 | 300.2 | 303.5 | 304.8 | 391.1 | 288.5 | | 16 | 80 | 3669.3 | 0.1 | 6.9 | 95.3 | 19.2 | 7.0 | 193.2 | 0.0 | 333.9 | 338.4 | 338.6 | 339.3 | 321.8 | | 16 | 88 | 3646.2 | 0.1 | 4.8 | 145.9 | 22.0 | 7.1 | 171.3 | 0.0 | 364.1 | 368.4 | 368.6 | 368.7 | 351.2 | | 16 | 96 | 3712.0 | 0.1 | 6.3 | 174.7 | 32.3 | 7.0 | 159.8 | 0.0 | 394.4 | 399.8 | 400.2 | 400.6 | 380.1 | | 16 | 104 | 3701.3 | 0.1 | 5.2 | 192.4 | 39.3 | 7.1 | 169.3 | 0.0 | 427.6 | 434.3 | 434.4 | 435.1 | 413.5 | | 16 | 112 | 3686.2 | 0.1 | 5.8 | 204.9 | 41.2 | 6.9 | 186.4 | 0.0 | 458.5 | 462.0 | 462.3 | 464.8 | 445.5 | | 16 | 120 | 3600.0 | 0.2 | 5.6 | 221.5 | 28.2 | 7.2 | 211.1 | 0.0 | 487.2 | 491.1 | 491.7 | 491.9 | 473.7 | | 16 | 128 | 3656.0 | 0.2 | 9.2 | 157.3 | 27.6 | 6.8 | 307.7 | 0.0 | 518.4 | 525.4 | 525.5 | 526.8 | 508.7 | | 16 | 136 | 3710.8 | 0.2 | 6.8 | 249.1 | 83.8 | 7.3 | 191.2 | 0.0 | 552.1 | 555.3 | 562.4 | 562.6 | 538.2 | | 16 | 144 | 3593.5 | 0.2 | 5.3 | 267.5 | 77.6 | 6.8 | 213.9 | 0.0 | 583.8 | 586.1 | 587.0 | 587.8 | 571.3 | | 16 | 152 | 3630.8 | 0.2 | 6.8 | 258.2 | 98.5 | 7.3 | 230.0 | 0.0 | 613.0 | 618.2 | 621.6 | 622.2 | 600.9 | | 16 | 160 | 3464.0 | 0.2 | 8.6 | 259.1 | 112.2 | 6.8 | 240.4 | 0.0 | 640.7 | 644.5 | 644.6 | 644.8 | 627.2 | | 16 | 168 | 3240.0 | 0.3 | 6.4 | 278.2 | 104.2 | 7.2 | 261.6 | 0.0 | 672.9 | 676.3 | 676.5 | 677.1 | 657.9 | | 16 | 176 | 3376.0 | 0.3 | 6.2 | 298.0 | 126.7 | 6.1 | 254.5 | 0.0 | 701.3 | 706.9 | 707.0 | 707.2 | 691.8 | | 16 | 184 | 3632.0 | 0.3 | 7.2 | 334.7 | 125.6 | 7.4 | 249.8 | 0.0 | 737.0 | 741.4 | 745.2 | 745.6 | 725.0 | | 16 | 192 | 3504.0 | 0.5 | 7.5 | 362.4 | 125.7 | 7.2 | 252.9 | 0.0 | 766.8 | 768.9 | 769.1 | 769.3 | 756.1 | | 16 | 200 | 3246.4 | 0.5 | 5.1 | 360.5 | 161.5 | 6.7 | 247.9 | 0.0 | 794.4 | 797.6 | 797.7 | 798.1 | 782.2 | | 16 | 208 | 3344.0 | 0.4 | 5.6 | 463.1 | 109.0 | 7.1 | 234.1 | 0.0 | 827.3 | 830.1 | 830.4 | 859.6 | 819.4 | | 16 | 216 | 3192.0 | 0.4 | 9.0 | 409.4 | 153.2 | 6.9 | 268.5 | 0.0 | 859.0 | 862.5 | 862.6 | 862.8 | 847.3 | | 16 | 224 | 3312.0 | 0.5 | 6.5 | 424.0 | 179.8 | 6.6 | 257.1 | 0.0 | 888.1 | 893.6 | 900.8 | 901.6 | 874.5 | | 16 | 232 | 3449.5 | 0.5 | 7.0 | 517.0 | 114.4 | 7.3 | 265.1 | 0.0 | 913.9 | 915.8 | 920.3 | 924.9 | 911.4 | | 16 | 240 | 3392.0 | 0.7 | 12.9 | 555.7 | 100.4 | 8.9 | 289.1 | 0.0 | 952.8 | 1071.4 | 1138.9 | 1139.4 | 967.6 | | 16 | 248 | 3321.6 | 0.7 | 6.1 | 474.4 | 132.1 | 8.3 | 339.2 | 0.0 | 959.6 | 967.6 | 968.1 | 968.5 | 960.8 | | 16 | 256 | 3152.0 | 0.7 | 6.1 | 583.5 | 118.6 | 7.7 | 287.4 | 0.0 | 1008.6 | 1026.3 | 1042.2 | 1042.6 | 1004.0 | </details> ## Advanced | Inference runtime | Mnemonic used in scripts | |-------------------|--------------------------| | [TorchScript Tracing](https://pytorch.org/docs/stable/jit.html) | `ts-trace` | | [TorchScript Scripting](https://pytorch.org/docs/stable/jit.html) | `ts-script` | | [ONNX](https://onnx.ai) | `onnx` | | [NVIDIA TensorRT](https://developer.nvidia.com/tensorrt) | `trt` | ### Step by step deployment process Commands described below can be used for exporting, converting and profiling the model. #### Clone Repository IMPORTANT: This step is executed on the host computer. <details> <summary>Clone Repository Command</summary> ```shell git clone https://github.com/NVIDIA/DeepLearningExamples.git cd DeepLearningExamples/PyTorch/Forecasting/TFT ``` </details> #### Setup Environment Setup the environment in the host computer and start Triton Inference Server. <details> <summary>Setup Environment Command</summary> ```shell source ./triton/scripts/setup_environment.sh bash ./triton/scripts/docker/triton_inference_server.sh ``` </details> #### Prepare Dataset. Please use the data download from the [Main QSG](https://github.com/NVIDIA/DeepLearningExamples/tree/master/PyTorch/Forecasting/TFT#quick-start-guide) #### Prepare Checkpoint Please place a `checkpoint.pt` from TFT trained on electricity in `runner_workspace/checkpoints/electricity_bin/`. Note that the `electricity_bin` subdirectory may not be created yet. In addition one can download a zip archive of a trained checkpoint [here](https://api.ngc.nvidia.com/v2/models/nvidia/dle/tft_base_pyt_ckpt_ds-electricity/versions/22.11.0_amp/zip) #### Setup Container Build and run a container that extends the NGC PyTorch container with the Triton Inference Server client libraries and dependencies. <details> <summary>Setup Container Command</summary> ```shell bash ./triton/scripts/docker/build.sh bash ./triton/scripts/docker/interactive.sh /path/to/your/data/ ``` </details> #### Prepare configuration You can use the environment variables to set the parameters of your inference configuration. Example values of some key variables in one configuration: <details> <summary>Export Variables</summary> ```shell WORKDIR="${WORKDIR:=$(pwd)}" export DATASETS_DIR=${WORKDIR}/datasets export WORKSPACE_DIR=${WORKDIR}/runner_workspace export CHECKPOINTS_DIR=${WORKSPACE_DIR}/checkpoints export MODEL_REPOSITORY_PATH=${WORKSPACE_DIR}/model_store export SHARED_DIR=${WORKSPACE_DIR}/shared_dir export MODEL_NAME=TFT export ENSEMBLE_MODEL_NAME= export TRITON_LOAD_MODEL_METHOD=explicit export TRITON_INSTANCES=1 export FORMAT="trt" export PRECISION="fp16" export ACCELERATOR="none" export TRITON_GPU_ENGINE_COUNT="2" export CAPTURE_CUDA_GRAPH="0" export BATCH_SIZE="1,2,4,8,16,32,64,128,256,512,1024" export TRITON_MAX_QUEUE_DELAY="1" export MAX_BATCH_SIZE="1024" export BATCH_SIZES="1 2 4 8 16 32 64 128 256 512 1024" export TRITON_PREFERRED_BATCH_SIZES="512 1024" export EXPORT_FORMAT="onnx" export EXPORT_PRECISION="fp32" export DATASET="electricity_bin" export DEVICE="gpu" export REQUEST_COUNT="500" export CHECKPOINT_VARIANT="electricity_bin" export CHECKPOINT_DIR=${CHECKPOINTS_DIR}/${CHECKPOINT_VARIANT} ``` </details> #### Export Model Export model from Python source to desired format (e.g. Savedmodel or TorchScript) <details> <summary>Export Model Command</summary> ```shell if [[ "${EXPORT_FORMAT}" == "ts-trace" || "${EXPORT_FORMAT}" == "ts-script" ]]; then export FORMAT_SUFFIX="pt" else export FORMAT_SUFFIX="${EXPORT_FORMAT}" fi python3 triton/export_model.py \ --input-path triton/model.py \ --input-type pyt \ --output-path ${SHARED_DIR}/exported_model.${FORMAT_SUFFIX} \ --output-type ${EXPORT_FORMAT} \ --ignore-unknown-parameters \ --onnx-opset 13 \ \ --checkpoint ${CHECKPOINT_DIR}/ \ --precision ${EXPORT_PRECISION} \ \ --dataloader triton/dataloader.py \ --dataset ${DATASETS_DIR}/${DATASET} \ --batch-size 1 ``` </details> #### Convert Model Convert the model from training to inference format (e.g. TensorRT). <details> <summary>Convert Model Command</summary> ```shell if [[ "${EXPORT_FORMAT}" == "ts-trace" || "${EXPORT_FORMAT}" == "ts-script" ]]; then export FORMAT_SUFFIX="pt" else export FORMAT_SUFFIX="${EXPORT_FORMAT}" fi model-navigator convert \ --model-name ${MODEL_NAME} \ --model-path ${SHARED_DIR}/exported_model.${FORMAT_SUFFIX} \ --output-path ${SHARED_DIR}/converted_model \ --target-formats ${FORMAT} \ --target-precisions ${PRECISION} \ --launch-mode local \ --override-workspace \ --verbose \ \ --onnx-opsets 13 \ --max-batch-size ${MAX_BATCH_SIZE} \ --container-version 21.08 \ --max-workspace-size 10000000000 \ --atol target__0=100 \ --rtol target__0=100 ``` </details> #### Deploy Model Configure the model on Triton Inference Server. Generate the configuration from your model repository. <details> <summary>Deploy Model Command</summary> ```shell if [[ "${FORMAT}" == "ts-trace" || "${FORMAT}" == "ts-script" ]]; then export CONFIG_FORMAT="torchscript" else export CONFIG_FORMAT="${FORMAT}" fi model-navigator triton-config-model \ --model-repository ${MODEL_REPOSITORY_PATH} \ --model-name ${MODEL_NAME} \ --model-version 1 \ --model-path ${SHARED_DIR}/converted_model \ --model-format ${CONFIG_FORMAT} \ --model-control-mode ${TRITON_LOAD_MODEL_METHOD} \ --load-model \ --load-model-timeout-s 100 \ --verbose \ \ --backend-accelerator ${ACCELERATOR} \ --tensorrt-precision ${PRECISION} \ --tensorrt-capture-cuda-graph \ --tensorrt-max-workspace-size 10000000000 \ --max-batch-size ${MAX_BATCH_SIZE} \ --batching dynamic \ --preferred-batch-sizes ${TRITON_PREFERRED_BATCH_SIZES} \ --max-queue-delay-us ${TRITON_MAX_QUEUE_DELAY} \ --engine-count-per-device ${DEVICE}=${TRITON_GPU_ENGINE_COUNT} ``` </details> #### Prepare Triton Profiling Data Prepare data used for profiling on Triton server. <details> <summary>Prepare Triton Profiling Data Command</summary> ```shell mkdir -p ${SHARED_DIR}/input_data python triton/prepare_input_data.py \ --input-data-dir ${SHARED_DIR}/input_data/ \ --dataset ${DATASETS_DIR}/${DATASET} \ --checkpoint ${CHECKPOINT_DIR}/ ``` </details> #### Triton Performance Offline Test We want to maximize throughput. It assumes you have your data available for inference or that your data saturate to maximum batch size quickly. Triton Inference Server supports offline scenarios with static batching. Static batching allows inference requests to be served as they are received. The largest improvements to throughput come from increasing the batch size due to efficiency gains in the GPU with larger batches. <details> <summary>Triton Performance Offline Test Command</summary> ```shell python triton/run_performance_on_triton.py \ --model-repository ${MODEL_REPOSITORY_PATH} \ --model-name ${MODEL_NAME} \ --input-data ${SHARED_DIR}/input_data/data.json \ --batch-sizes ${BATCH_SIZE} \ --number-of-triton-instances ${TRITON_INSTANCES} \ --batching-mode static \ --evaluation-mode offline \ --measurement-request-count ${REQUEST_COUNT} \ --warmup \ --performance-tool perf_analyzer \ --result-path ${SHARED_DIR}/triton_performance_offline.csv ``` </details> #### Triton Performance Online Test We want to maximize throughput within latency budget constraints. Dynamic batching is a feature of Triton Inference Server that allows inference requests to be combined by the server, so that a batch is created dynamically, resulting in a reduced average latency. <details> <summary>Triton Performance Online Test</summary> ```shell python triton/run_performance_on_triton.py \ --model-repository ${MODEL_REPOSITORY_PATH} \ --model-name ${MODEL_NAME} \ --input-data ${SHARED_DIR}/input_data/data.json \ --batch-sizes ${BATCH_SIZE} \ --number-of-triton-instances ${TRITON_INSTANCES} \ --number-of-model-instances ${TRITON_GPU_ENGINE_COUNT} \ --batching-mode dynamic \ --evaluation-mode online \ --measurement-request-count 500 \ --warmup \ --performance-tool perf_analyzer \ --result-path ${SHARED_DIR}/triton_performance_online.csv ``` </details> ### Latency explanation A typical Triton Inference Server pipeline can be broken down into the following steps: 1. The client serializes the inference request into a message and sends it to the server (Client Send). 2. The message travels over the network from the client to the server (Network). 3. The message arrives at the server and is deserialized (Server Receive). 4. The request is placed on the queue (Server Queue). 5. The request is removed from the queue and computed (Server Compute). 6. The completed request is serialized in a message and sent back to the client (Server Send). 7. The completed message then travels over the network from the server to the client (Network). 8. The completed message is deserialized by the client and processed as a completed inference request (Client Receive). Generally, for local clients, steps 1-4 and 6-8 will only occupy a small fraction of time, compared to step 5. As backend deep learning systems like TFT are rarely exposed directly to end users, but instead only interfacing with local front-end servers, for the sake of TFT, we can consider that all clients are local. ## Release Notes We’re constantly refining and improving our performance on AI and HPC workloads even on the same hardware with frequent updates to our software stack. For our latest performance data refer to these pages for [AI](https://developer.nvidia.com/deep-learning-performance-training-inference) and [HPC](https://developer.nvidia.com/hpc-application-performance) benchmarks. ### Changelog February 2022 - Initial release ### Known issues - There are no known issues with this model.
TensorFlow/LanguageModeling/BERT
BERT
__init__
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License.
PyTorch/Recommendation/DLRM/tests/feature_specs
feature_specs
default
channel_spec: categorical: - cat_0.bin - cat_1.bin - cat_2.bin - cat_3.bin - cat_4.bin - cat_5.bin - cat_6.bin - cat_7.bin - cat_8.bin - cat_9.bin - cat_10.bin - cat_11.bin - cat_12.bin - cat_13.bin - cat_14.bin - cat_15.bin - cat_16.bin - cat_17.bin - cat_18.bin - cat_19.bin - cat_20.bin - cat_21.bin - cat_22.bin - cat_23.bin - cat_24.bin - cat_25.bin label: - label numerical: &id001 - num_0 - num_1 - num_2 - num_3 - num_4 - num_5 - num_6 - num_7 - num_8 - num_9 - num_10 - num_11 - num_12 feature_spec: cat_0.bin: cardinality: 100000 dtype: int32 cat_1.bin: cardinality: 100000 dtype: int32 cat_10.bin: cardinality: 100000 dtype: int32 cat_11.bin: cardinality: 100000 dtype: int32 cat_12.bin: cardinality: 100000 dtype: int32 cat_13.bin: cardinality: 100000 dtype: int32 cat_14.bin: cardinality: 100000 dtype: int32 cat_15.bin: cardinality: 100000 dtype: int32 cat_16.bin: cardinality: 100000 dtype: int32 cat_17.bin: cardinality: 100000 dtype: int32 cat_18.bin: cardinality: 100000 dtype: int32 cat_19.bin: cardinality: 100000 dtype: int32 cat_2.bin: cardinality: 100000 dtype: int32 cat_20.bin: cardinality: 100000 dtype: int32 cat_21.bin: cardinality: 100000 dtype: int32 cat_22.bin: cardinality: 100000 dtype: int32 cat_23.bin: cardinality: 100000 dtype: int32 cat_24.bin: cardinality: 100000 dtype: int32 cat_25.bin: cardinality: 100000 dtype: int32 cat_3.bin: cardinality: 100000 dtype: int32 cat_4.bin: cardinality: 100000 dtype: int32 cat_5.bin: cardinality: 100000 dtype: int32 cat_6.bin: cardinality: 100000 dtype: int32 cat_7.bin: cardinality: 100000 dtype: int32 cat_8.bin: cardinality: 100000 dtype: int32 cat_9.bin: cardinality: 100000 dtype: int32 label: dtype: bool num_0: dtype: float16 num_1: dtype: float16 num_10: dtype: float16 num_11: dtype: float16 num_12: dtype: float16 num_2: dtype: float16 num_3: dtype: float16 num_4: dtype: float16 num_5: dtype: float16 num_6: dtype: float16 num_7: dtype: float16 num_8: dtype: float16 num_9: dtype: float16 metadata: {} source_spec: test: - features: *id001 files: - test/numerical.bin type: split_binary - features: - label files: - test/label.bin type: split_binary - features: - cat_0.bin files: - test/cat_0.bin type: split_binary - features: - cat_1.bin files: - test/cat_1.bin type: split_binary - features: - cat_2.bin files: - test/cat_2.bin type: split_binary - features: - cat_3.bin files: - test/cat_3.bin type: split_binary - features: - cat_4.bin files: - test/cat_4.bin type: split_binary - features: - cat_5.bin files: - test/cat_5.bin type: split_binary - features: - cat_6.bin files: - test/cat_6.bin type: split_binary - features: - cat_7.bin files: - test/cat_7.bin type: split_binary - features: - cat_8.bin files: - test/cat_8.bin type: split_binary - features: - cat_9.bin files: - test/cat_9.bin type: split_binary - features: - cat_10.bin files: - test/cat_10.bin type: split_binary - features: - cat_11.bin files: - test/cat_11.bin type: split_binary - features: - cat_12.bin files: - test/cat_12.bin type: split_binary - features: - cat_13.bin files: - test/cat_13.bin type: split_binary - features: - cat_14.bin files: - test/cat_14.bin type: split_binary - features: - cat_15.bin files: - test/cat_15.bin type: split_binary - features: - cat_16.bin files: - test/cat_16.bin type: split_binary - features: - cat_17.bin files: - test/cat_17.bin type: split_binary - features: - cat_18.bin files: - test/cat_18.bin type: split_binary - features: - cat_19.bin files: - test/cat_19.bin type: split_binary - features: - cat_20.bin files: - test/cat_20.bin type: split_binary - features: - cat_21.bin files: - test/cat_21.bin type: split_binary - features: - cat_22.bin files: - test/cat_22.bin type: split_binary - features: - cat_23.bin files: - test/cat_23.bin type: split_binary - features: - cat_24.bin files: - test/cat_24.bin type: split_binary - features: - cat_25.bin files: - test/cat_25.bin type: split_binary train: - features: *id001 files: - train/numerical.bin type: split_binary - features: - label files: - train/label.bin type: split_binary - features: - cat_0.bin files: - train/cat_0.bin type: split_binary - features: - cat_1.bin files: - train/cat_1.bin type: split_binary - features: - cat_2.bin files: - train/cat_2.bin type: split_binary - features: - cat_3.bin files: - train/cat_3.bin type: split_binary - features: - cat_4.bin files: - train/cat_4.bin type: split_binary - features: - cat_5.bin files: - train/cat_5.bin type: split_binary - features: - cat_6.bin files: - train/cat_6.bin type: split_binary - features: - cat_7.bin files: - train/cat_7.bin type: split_binary - features: - cat_8.bin files: - train/cat_8.bin type: split_binary - features: - cat_9.bin files: - train/cat_9.bin type: split_binary - features: - cat_10.bin files: - train/cat_10.bin type: split_binary - features: - cat_11.bin files: - train/cat_11.bin type: split_binary - features: - cat_12.bin files: - train/cat_12.bin type: split_binary - features: - cat_13.bin files: - train/cat_13.bin type: split_binary - features: - cat_14.bin files: - train/cat_14.bin type: split_binary - features: - cat_15.bin files: - train/cat_15.bin type: split_binary - features: - cat_16.bin files: - train/cat_16.bin type: split_binary - features: - cat_17.bin files: - train/cat_17.bin type: split_binary - features: - cat_18.bin files: - train/cat_18.bin type: split_binary - features: - cat_19.bin files: - train/cat_19.bin type: split_binary - features: - cat_20.bin files: - train/cat_20.bin type: split_binary - features: - cat_21.bin files: - train/cat_21.bin type: split_binary - features: - cat_22.bin files: - train/cat_22.bin type: split_binary - features: - cat_23.bin files: - train/cat_23.bin type: split_binary - features: - cat_24.bin files: - train/cat_24.bin type: split_binary - features: - cat_25.bin files: - train/cat_25.bin type: split_binary