def testTpuZone(self): FLAGS['tpu_zone'].parse('us-central1-c') result = benchmark_config_spec._TpuGroupSpec(_COMPONENT, _GROUP_NAME, flag_values=FLAGS, **self.full_spec) self.assertEqual(result.tpu_zone, 'us-central1-c')
def testCustomTpuName(self): spec = MergeDicts(self.minimal_spec, {'tpu_name': 'pkb-tpu'}) result = benchmark_config_spec._TpuGroupSpec(_COMPONENT, _GROUP_NAME, flag_values=FLAGS, **spec) self.assertEqual(result.tpu_name, 'pkb-tpu')
def testTpuCidrRangeFlag(self): FLAGS['tpu_cidr_range'].parse('10.240.0.0/29') result = benchmark_config_spec._TpuGroupSpec(_COMPONENT, _GROUP_NAME, flag_values=FLAGS, **self.full_spec) self.assertEqual(result.tpu_cidr_range, '10.240.0.0/29')
def testTpuAcceleratorTypeFlag(self): FLAGS['tpu_accelerator_type'].parse('tpu-v1') result = benchmark_config_spec._TpuGroupSpec(_COMPONENT, _GROUP_NAME, flag_values=FLAGS, **self.full_spec) self.assertEqual(result.tpu_accelerator_type, 'tpu-v1')
def testCustomTpuVersion(self): spec = MergeDicts(self.minimal_spec, {'tpu_tf_version': 'nightly'}) result = benchmark_config_spec._TpuGroupSpec(_COMPONENT, _GROUP_NAME, flag_values=FLAGS, **spec) self.assertEqual(result.tpu_tf_version, 'nightly')
def testTpuNameFlag(self): FLAGS['tpu_name'].parse('pkb-tpu') result = benchmark_config_spec._TpuGroupSpec(_COMPONENT, _GROUP_NAME, flag_values=FLAGS, **self.full_spec) self.assertEqual(result.tpu_name, 'pkb-tpu')
def testCustomTpuZone(self): spec = MergeDicts(self.minimal_spec, {'tpu_zone': 'us-central1-a'}) result = benchmark_config_spec._TpuGroupSpec(_COMPONENT, _GROUP_NAME, flag_values=FLAGS, **spec) self.assertEqual(result.tpu_zone, 'us-central1-a')
def testTpuNetworkFlag(self): FLAGS['tpu_network'].parse('my-tf-network') result = benchmark_config_spec._TpuGroupSpec(_COMPONENT, _GROUP_NAME, flag_values=FLAGS, **self.full_spec) self.assertEqual(result.tpu_network, 'my-tf-network')
def testCustomTpuNetwork(self): spec = MergeDicts(self.minimal_spec, {'tpu_network': 'default'}) result = benchmark_config_spec._TpuGroupSpec(_COMPONENT, _GROUP_NAME, flag_values=FLAGS, **spec) self.assertEqual(result.tpu_network, 'default')
def testCustomTpuDescription(self): spec = MergeDicts(self.minimal_spec, {'tpu_description': 'My TF Node'}) result = benchmark_config_spec._TpuGroupSpec(_COMPONENT, _GROUP_NAME, flag_values=FLAGS, **spec) self.assertEqual(result.tpu_description, 'My TF Node')
def testTpuDescriptionFlag(self): FLAGS['tpu_description'].parse('MyTfNode') result = benchmark_config_spec._TpuGroupSpec(_COMPONENT, _GROUP_NAME, flag_values=FLAGS, **self.full_spec) self.assertEqual(result.tpu_description, 'MyTfNode')
def testTpuTfVersion(self): FLAGS['tpu_tf_version'].parse('1.2') result = benchmark_config_spec._TpuGroupSpec(_COMPONENT, _GROUP_NAME, flag_values=FLAGS, **self.full_spec) self.assertEqual(result.tpu_tf_version, '1.2')
def testCustomTpuAcceleratorType(self): spec = MergeDicts(self.minimal_spec, {'tpu_accelerator_type': 'tpu-v2'}) result = benchmark_config_spec._TpuGroupSpec(_COMPONENT, _GROUP_NAME, flag_values=FLAGS, **spec) self.assertEqual(result.tpu_accelerator_type, 'tpu-v2')
def testCustomTpuCidrRange(self): spec = MergeDicts(self.minimal_spec, {'tpu_cidr_range': '192.168.0.0/29'}) result = benchmark_config_spec._TpuGroupSpec(_COMPONENT, _GROUP_NAME, flag_values=FLAGS, **spec) self.assertEqual(result.tpu_cidr_range, '192.168.0.0/29')
def testTpuNameFlag(self): self.flags['tpu_name'].parse('pkb-tpu') result = benchmark_config_spec._TpuGroupSpec( _COMPONENT, _GROUP_NAME, flag_values=self.flags, **self.full_spec) self.assertEqual(result.tpu_name, 'pkb-tpu')
def testDefaultTpuVersion(self): result = benchmark_config_spec._TpuGroupSpec( _COMPONENT, _GROUP_NAME, flag_values=self.flags, **self.minimal_spec) self.assertEqual(result.tpu_tf_version, None)
def testCustomTpuVersion(self): spec = MergeDicts(self.minimal_spec, {'tpu_tf_version': 'nightly'}) result = benchmark_config_spec._TpuGroupSpec( _COMPONENT, _GROUP_NAME, flag_values=self.flags, **spec) self.assertEqual(result.tpu_tf_version, 'nightly')
def testCustomTpuNetwork(self): spec = MergeDicts(self.minimal_spec, {'tpu_network': 'default'}) result = benchmark_config_spec._TpuGroupSpec( _COMPONENT, _GROUP_NAME, flag_values=self.flags, **spec) self.assertEqual(result.tpu_network, 'default')
def testCustomTpuZone(self): spec = MergeDicts(self.minimal_spec, {'tpu_zone': 'us-central1-a'}) result = benchmark_config_spec._TpuGroupSpec( _COMPONENT, _GROUP_NAME, flag_values=self.flags, **spec) self.assertEqual(result.tpu_zone, 'us-central1-a')
def testCustomTpuAcceleratorType(self): spec = MergeDicts(self.minimal_spec, {'tpu_accelerator_type': 'tpu-v2'}) result = benchmark_config_spec._TpuGroupSpec( _COMPONENT, _GROUP_NAME, flag_values=self.flags, **spec) self.assertEqual(result.tpu_accelerator_type, 'tpu-v2')
def testCustomTpuDescription(self): spec = MergeDicts(self.minimal_spec, {'tpu_description': 'My TF Node'}) result = benchmark_config_spec._TpuGroupSpec( _COMPONENT, _GROUP_NAME, flag_values=self.flags, **spec) self.assertEqual(result.tpu_description, 'My TF Node')
def testCustomTpuCidrRange(self): spec = MergeDicts(self.minimal_spec, {'tpu_cidr_range': '192.168.0.0/29'}) result = benchmark_config_spec._TpuGroupSpec( _COMPONENT, _GROUP_NAME, flag_values=self.flags, **spec) self.assertEqual(result.tpu_cidr_range, '192.168.0.0/29')
def testDefaultTpuZone(self): result = benchmark_config_spec._TpuGroupSpec(_COMPONENT, _GROUP_NAME, flag_values=self.flags, **self.minimal_spec) self.assertEqual(result.tpu_zone, None)
def testCustomTpuName(self): spec = MergeDicts(self.minimal_spec, {'tpu_name': 'pkb-tpu'}) result = benchmark_config_spec._TpuGroupSpec( _COMPONENT, _GROUP_NAME, flag_values=self.flags, **spec) self.assertEqual(result.tpu_name, 'pkb-tpu')
def testDefaultTpuAcceleratorType(self): result = benchmark_config_spec._TpuGroupSpec(_COMPONENT, _GROUP_NAME, flag_values=FLAGS, **self.minimal_spec) self.assertEqual(result.tpu_accelerator_type, None)
def testTpuDescriptionFlag(self): self.flags['tpu_description'].parse('MyTfNode') result = benchmark_config_spec._TpuGroupSpec( _COMPONENT, _GROUP_NAME, flag_values=self.flags, **self.full_spec) self.assertEqual(result.tpu_description, 'MyTfNode')
def testTpuCidrRangeFlag(self): self.flags['tpu_cidr_range'].parse('10.240.0.0/29') result = benchmark_config_spec._TpuGroupSpec( _COMPONENT, _GROUP_NAME, flag_values=self.flags, **self.full_spec) self.assertEqual(result.tpu_cidr_range, '10.240.0.0/29')
def testDefaultTpuVersion(self): result = benchmark_config_spec._TpuGroupSpec(_COMPONENT, _GROUP_NAME, flag_values=FLAGS, **self.minimal_spec) self.assertEqual(result.tpu_tf_version, None)
def testTpuAcceleratorTypeFlag(self): self.flags['tpu_accelerator_type'].parse('tpu-v1') result = benchmark_config_spec._TpuGroupSpec( _COMPONENT, _GROUP_NAME, flag_values=self.flags, **self.full_spec) self.assertEqual(result.tpu_accelerator_type, 'tpu-v1')
def testTpuTfVersion(self): self.flags['tpu_tf_version'].parse('1.2') result = benchmark_config_spec._TpuGroupSpec( _COMPONENT, _GROUP_NAME, flag_values=self.flags, **self.full_spec) self.assertEqual(result.tpu_tf_version, '1.2')
def testTpuNetworkFlag(self): self.flags['tpu_network'].parse('my-tf-network') result = benchmark_config_spec._TpuGroupSpec( _COMPONENT, _GROUP_NAME, flag_values=self.flags, **self.full_spec) self.assertEqual(result.tpu_network, 'my-tf-network')
def testMinimalConfig(self): result = benchmark_config_spec._TpuGroupSpec( _COMPONENT, _GROUP_NAME, flag_values=self.flags, **self.minimal_spec) self.assertEqual(result.cloud, 'GCP')
def testTpuZone(self): self.flags['tpu_zone'].parse('us-central1-c') result = benchmark_config_spec._TpuGroupSpec( _COMPONENT, _GROUP_NAME, flag_values=self.flags, **self.full_spec) self.assertEqual(result.tpu_zone, 'us-central1-c')
def testMinimalConfig(self): result = benchmark_config_spec._TpuGroupSpec(_COMPONENT, _GROUP_NAME, flag_values=FLAGS, **self.minimal_spec) self.assertEqual(result.cloud, 'GCP')
def testDefaultTpuName(self): result = benchmark_config_spec._TpuGroupSpec( _COMPONENT, _GROUP_NAME, flag_values=self.flags, **self.minimal_spec) self.assertEqual(result.tpu_name, 'pkb-tpu-train-123')
def testDefaultTpuName(self): result = benchmark_config_spec._TpuGroupSpec(_COMPONENT, _GROUP_NAME, flag_values=FLAGS, **self.minimal_spec) self.assertEqual(result.tpu_name, 'pkb-tpu-train-123')
def testDefaultTpuCidrRange(self): result = benchmark_config_spec._TpuGroupSpec( _COMPONENT, _GROUP_NAME, flag_values=self.flags, **self.minimal_spec) self.assertEqual(result.tpu_cidr_range, None)
def testDefaultTpuCidrRange(self): result = benchmark_config_spec._TpuGroupSpec(_COMPONENT, _GROUP_NAME, flag_values=FLAGS, **self.minimal_spec) self.assertEqual(result.tpu_cidr_range, None)
def testDefaultTpuAcceleratorType(self): result = benchmark_config_spec._TpuGroupSpec( _COMPONENT, _GROUP_NAME, flag_values=self.flags, **self.minimal_spec) self.assertEqual(result.tpu_accelerator_type, None)
def testDefaultTpuNetwork(self): result = benchmark_config_spec._TpuGroupSpec( _COMPONENT, _GROUP_NAME, flag_values=FLAGS, **self.minimal_spec) self.assertEqual(result.tpu_network, None)