def testCustomCloudTpuCidrRange(self):
     spec = MergeDicts(self.minimal_spec,
                       {'tpu_cidr_range': '192.168.0.0/29'})
     result = benchmark_config_spec._CloudTpuSpec(_COMPONENT,
                                                  flag_values=self.flags,
                                                  **spec)
     self.assertEqual(result.tpu_cidr_range, '192.168.0.0/29')
 def testCustomCloudTpuAcceleratorType(self):
     spec = MergeDicts(self.minimal_spec,
                       {'tpu_accelerator_type': 'tpu-v2'})
     result = benchmark_config_spec._CloudTpuSpec(_COMPONENT,
                                                  flag_values=self.flags,
                                                  **spec)
     self.assertEqual(result.tpu_accelerator_type, 'tpu-v2')
示例#3
0
 def testMinimalConfig(self):
   result = benchmark_config_spec._CloudTpuSpec(
       _COMPONENT, flag_values=self.flags, **self.minimal_spec)
   self.assertEqual(result.cloud, 'GCP')
示例#4
0
 def testTpuZone(self):
   self.flags['tpu_zone'].parse('us-central1-c')
   result = benchmark_config_spec._CloudTpuSpec(
       _COMPONENT, flag_values=self.flags, **self.full_spec)
   self.assertEqual(result.tpu_zone, 'us-central1-c')
示例#5
0
 def testTpuTfVersion(self):
   self.flags['tpu_tf_version'].parse('1.2')
   result = benchmark_config_spec._CloudTpuSpec(
       _COMPONENT, flag_values=self.flags, **self.full_spec)
   self.assertEqual(result.tpu_tf_version, '1.2')
示例#6
0
 def testTpuNetworkFlag(self):
   self.flags['tpu_network'].parse('my-tf-network')
   result = benchmark_config_spec._CloudTpuSpec(
       _COMPONENT, flag_values=self.flags, **self.full_spec)
   self.assertEqual(result.tpu_network, 'my-tf-network')
示例#7
0
 def testDefaultCloudTpuAcceleratorType(self):
   result = benchmark_config_spec._CloudTpuSpec(
       _COMPONENT, flag_values=self.flags, **self.minimal_spec)
   self.assertEqual(result.tpu_accelerator_type, None)
示例#8
0
 def testDefaultCloudTpuCidrRange(self):
   result = benchmark_config_spec._CloudTpuSpec(
       _COMPONENT, flag_values=self.flags, **self.minimal_spec)
   self.assertEqual(result.tpu_cidr_range, None)
示例#9
0
 def testCloudTpuNameFlag(self):
   self.flags['tpu_name'].parse('pkb-tpu')
   result = benchmark_config_spec._CloudTpuSpec(
       _COMPONENT, flag_values=self.flags, **self.full_spec)
   self.assertEqual(result.tpu_name, 'pkb-tpu')
示例#10
0
 def testCustomCloudTpuVersion(self):
   spec = MergeDicts(self.minimal_spec, {'tpu_tf_version': 'nightly'})
   result = benchmark_config_spec._CloudTpuSpec(
       _COMPONENT, flag_values=self.flags, **spec)
   self.assertEqual(result.tpu_tf_version, 'nightly')
示例#11
0
 def testDefaultCloudTpuVersion(self):
   result = benchmark_config_spec._CloudTpuSpec(
       _COMPONENT, flag_values=self.flags, **self.minimal_spec)
   self.assertEqual(result.tpu_tf_version, None)
示例#12
0
 def testCustomCloudTpuZone(self):
   spec = MergeDicts(self.minimal_spec, {'tpu_zone': 'us-central1-a'})
   result = benchmark_config_spec._CloudTpuSpec(
       _COMPONENT, flag_values=self.flags, **spec)
   self.assertEqual(result.tpu_zone, 'us-central1-a')
示例#13
0
 def testCustomCloudTpuNetwork(self):
   spec = MergeDicts(self.minimal_spec, {'tpu_network': 'default'})
   result = benchmark_config_spec._CloudTpuSpec(
       _COMPONENT, flag_values=self.flags, **spec)
   self.assertEqual(result.tpu_network, 'default')
示例#14
0
 def testCustomCloudTpuDescription(self):
   spec = MergeDicts(self.minimal_spec, {'tpu_description': 'My TF Node'})
   result = benchmark_config_spec._CloudTpuSpec(
       _COMPONENT, flag_values=self.flags, **spec)
   self.assertEqual(result.tpu_description, 'My TF Node')
示例#15
0
 def testDefaultCloudTpuName(self):
   result = benchmark_config_spec._CloudTpuSpec(
       _COMPONENT, flag_values=self.flags, **self.minimal_spec)
   self.assertEqual(result.tpu_name, 'pkb-tpu-123')
示例#16
0
 def testCustomCloudTpuName(self):
   spec = MergeDicts(self.minimal_spec, {'tpu_name': 'pkb-tpu'})
   result = benchmark_config_spec._CloudTpuSpec(
       _COMPONENT, flag_values=self.flags, **spec)
   self.assertEqual(result.tpu_name, 'pkb-tpu')
示例#17
0
 def testTpuCidrRangeFlag(self):
   self.flags['tpu_cidr_range'].parse('10.240.0.0/29')
   result = benchmark_config_spec._CloudTpuSpec(
       _COMPONENT, flag_values=self.flags, **self.full_spec)
   self.assertEqual(result.tpu_cidr_range, '10.240.0.0/29')
示例#18
0
 def testCustomCloudTpuCidrRange(self):
   spec = MergeDicts(self.minimal_spec, {'tpu_cidr_range': '192.168.0.0/29'})
   result = benchmark_config_spec._CloudTpuSpec(
       _COMPONENT, flag_values=self.flags, **spec)
   self.assertEqual(result.tpu_cidr_range, '192.168.0.0/29')
示例#19
0
 def testTpuAcceleratorTypeFlag(self):
   self.flags['tpu_accelerator_type'].parse('tpu-v1')
   result = benchmark_config_spec._CloudTpuSpec(
       _COMPONENT, flag_values=self.flags, **self.full_spec)
   self.assertEqual(result.tpu_accelerator_type, 'tpu-v1')
示例#20
0
 def testCustomCloudTpuAcceleratorType(self):
   spec = MergeDicts(self.minimal_spec, {'tpu_accelerator_type': 'tpu-v2'})
   result = benchmark_config_spec._CloudTpuSpec(
       _COMPONENT, flag_values=self.flags, **spec)
   self.assertEqual(result.tpu_accelerator_type, 'tpu-v2')
示例#21
0
 def testTpuDescriptionFlag(self):
   self.flags['tpu_description'].parse('MyTfNode')
   result = benchmark_config_spec._CloudTpuSpec(
       _COMPONENT, flag_values=self.flags, **self.full_spec)
   self.assertEqual(result.tpu_description, 'MyTfNode')