8000 [XLA:GPU] Mark constant pass attributes · IBMZ-Linux-OSS-Python/tensorflow@61688d4 · GitHub
[go: up one dir, main page]

Skip to content
8000

Commit 61688d4

Browse filesBrowse files
frgossentensorflower-gardener
authored andcommitted
[XLA:GPU] Mark constant pass attributes
PiperOrigin-RevId: 766362560
1 parent 5e422a9 commit 61688d4

File tree

7 files changed

+24
-20
lines changed

7 files changed

+24
-20
lines changed

third_party/xla/xla/service/gpu/transforms/collectives/all_gather_combiner.h

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,11 @@ class GpuAllGatherCombiner : public AllGatherCombiner {
3636
public:
3737
GpuAllGatherCombiner(const se::DeviceDescription& device_info,
3838
const int default_combine_threshold_in_bytes,
39-
int64_t combine_threshold_in_bytes,
40-
int64_t combine_threshold_count, bool combine_by_dim,
41-
bool combine_different_dtypes, int64_t pointer_size)
39+
const int64_t combine_threshold_in_bytes,
40+
const int64_t combine_threshold_count,
41+
const bool combine_by_dim,
42+
const bool combine_different_dtypes,
43+
const int64_t pointer_size)
4244
: AllGatherCombiner(combine_threshold_in_bytes, combine_threshold_count,
4345
combine_by_dim, combine_different_dtypes),
4446
device_info_(device_info),
@@ -55,7 +57,7 @@ class GpuAllGatherCombiner : public AllGatherCombiner {
5557
private:
5658
const se::DeviceDescription& device_info_;
5759
const int default_combine_threshold_in_bytes_;
58-
int64_t pointer_size_;
60+
const int64_t pointer_size_;
5961
};
6062

6163
} // namespace xla::gpu

third_party/xla/xla/service/gpu/transforms/collectives/all_gather_dynamic_slice_simplifier.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ class AllGatherDynamicSliceSimplifier : public OpExpanderPass {
4848
static Config DefaultConfig() { return {}; }
4949

5050
explicit AllGatherDynamicSliceSimplifier(
51-
Config config = AllGatherDynamicSliceSimplifier::DefaultConfig())
51+
const Config config = AllGatherDynamicSliceSimplifier::DefaultConfig())
5252
: config_(std::move(config)) {}
5353

5454
absl::string_view name() const override {
@@ -62,7 +62,7 @@ class AllGatherDynamicSliceSimplifier : public OpExpanderPass {
6262
HloInstruction* instruction) override;
6363

6464
private:
65-
Config config_;
65+
const Config config_;
6666
};
6767

6868
} // namespace xla

third_party/xla/xla/service/gpu/transforms/collectives/all_reduce_blueconnect.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ namespace xla {
3737
// that host IDs are ordered corresponding to network hierarchy.
3838
class AllReduceBlueConnect : public HloModulePass {
3939
public:
40-
explicit AllReduceBlueConnect(size_t num_devices_per_host)
40+
explicit AllReduceBlueConnect(const size_t num_devices_per_host)
4141
: num_devices_per_host_(num_devices_per_host) {}
4242

4343
absl::string_view name() const override { return "all-reduce-blueconnect"; }
@@ -48,7 +48,7 @@ class AllReduceBlueConnect : public HloModulePass {
4848
const absl::flat_hash_set<absl::string_view>& execution_threads) override;
4949

5050
private:
51-
size_t num_devices_per_host_;
51+
const size_t num_devices_per_host_;
5252
};
5353

5454
} // namespace xla

third_party/xla/xla/service/gpu/transforms/collectives/all_reduce_combiner.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,9 @@ class GpuAllReduceCombiner : public AllReduceCombiner {
3636
public:
3737
GpuAllReduceCombiner(const se::DeviceDescription& device_info,
3838
const int default_combine_threshold_in_bytes,
39-
int64_t combine_threshold_in_bytes,
40-
int64_t combine_threshold_count, int64_t pointer_size)
39+
const int64_t combine_threshold_in_bytes,
40+
const int64_t combine_threshold_count,
41+
const int64_t pointer_size)
4142
: AllReduceCombiner(combine_threshold_in_bytes, combine_threshold_count),
4243
device_info_(device_info),
4344
default_combine_threshold_in_bytes_(default_combine_threshold_in_bytes),
@@ -53,7 +54,7 @@ class GpuAllReduceCombiner : public AllReduceCombiner {
5354
private:
5455
const se::DeviceDescription& device_info_;
5556
const int default_combine_threshold_in_bytes_;
56-
int64_t pointer_size_;
57+
const int64_t pointer_size_;
5758
};
5859

5960
} // namespace xla::gpu

third_party/xla/xla/service/gpu/transforms/collectives/async_collective_annotator.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ namespace gpu {
3131
// Annotate async collectives with CollectiveBackendConfig.
3232
class AsyncCollectiveAnnotator : public HloModulePass {
3333
public:
34-
explicit AsyncCollectiveAnnotator(HloPredicate is_collective_async)
35-
: is_collective_async_(std::move(is_collective_async)) {}
34+
explicit AsyncCollectiveAnnotator(const HloPredicate is_collective_async)
35+
: is_collective_async_(is_collective_async) {}
3636
absl::string_view name() const override {
3737
return "async-collective-annotator";
3838
}
@@ -43,7 +43,7 @@ class AsyncCollectiveAnnotator : public HloModulePass {
4343
const absl::flat_hash_set<absl::string_view>& execution_threads) override;
4444

4545
private:
46-
HloPredicate is_collective_async_;
46+
const HloPredicate is_collective_async_;
4747
};
4848

4949
} // namespace gpu

third_party/xla/xla/service/gpu/transforms/collectives/collective_combiner_annotator.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ class CollectiveCombinerAnnotator : public HloModulePass {
4545
}
4646

4747
private:
48-
se::DeviceDescription device_info_;
49-
int64_t pointer_size_;
48+
const se::DeviceDescription device_info_;
49+
const int64_t pointer_size_;
5050
};
5151

5252
// Returns true if `instr` is a combinable sync collective. False otherwise.

third_party/xla/xla/service/gpu/transforms/collectives/reduce_scatter_combiner.h

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,10 @@ class GpuReduceScatterCombiner : public ReduceScatterCombiner {
3535
public:
3636
GpuReduceScatterCombiner(const se::DeviceDescription& device_info,
3737
const int default_combine_threshold_in_bytes,
38-
int64_t combine_threshold_in_bytes,
39-
int64_t combine_threshold_count, bool combine_by_dim,
40-
int64_t pointer_size)
38+
const int64_t combine_threshold_in_bytes,
39+
const int64_t combine_threshold_count,
40+
const bool combine_by_dim,
41+
const int64_t pointer_size)
4142
: ReduceScatterCombiner(combine_threshold_in_bytes,
4243
combine_threshold_count, combine_by_dim),
4344
device_info_(device_info),
@@ -56,7 +57,7 @@ class GpuReduceScatterCombiner : public ReduceScatterCombiner {
5657
private:
5758
const se::DeviceDescription& device_info_;
5859
const int default_combine_threshold_in_bytes_;
59-
int64_t pointer_size_;
60+
const int64_t pointer_size_;
6061
};
6162

6263
} // namespace xla::gpu

0 commit comments

Comments
 (0)
0