Skip to content

Commit

Permalink
fix write buffer size
Browse files Browse the repository at this point in the history
  • Loading branch information
jinchengchenghh committed Nov 27, 2024
1 parent 99e04f5 commit f7f6eec
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 13 deletions.
1 change: 1 addition & 0 deletions cpp/core/config/GlutenConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ const std::string kUGITokens = "spark.gluten.ugi.tokens";

const std::string kShuffleCompressionCodec = "spark.gluten.sql.columnar.shuffle.codec";
const std::string kShuffleCompressionCodecBackend = "spark.gluten.sql.columnar.shuffle.codecBackend";
const std::string kShuffleSpillDiskWriteBufferSize = "spark.shuffle.spill.diskWriteBufferSize";
const std::string kQatBackendName = "qat";
const std::string kIaaBackendName = "iaa";

Expand Down
2 changes: 1 addition & 1 deletion cpp/velox/compute/WholeStageResultIterator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ std::unordered_map<std::string, std::string> WholeStageResultIterator::getQueryC
configs[velox::core::QueryConfig::kMaxSpillBytes] =
std::to_string(veloxCfg_->get<uint64_t>(kMaxSpillBytes, 107374182400LL));
configs[velox::core::QueryConfig::kSpillWriteBufferSize] =
std::to_string(veloxCfg_->get<uint64_t>(kSpillWriteBufferSize, 1L * 1024 * 1024));
std::to_string(veloxCfg_->get<uint64_t>(kShuffleSpillDiskWriteBufferSize, 1L * 1024 * 1024));
configs[velox::core::QueryConfig::kSpillReadBufferSize] =
std::to_string(veloxCfg_->get<int32_t>(kSpillReadBufferSize, 1L * 1024 * 1024));
configs[velox::core::QueryConfig::kSpillStartPartitionBit] =
Expand Down
1 change: 0 additions & 1 deletion cpp/velox/config/VeloxConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ const std::string kSpillStartPartitionBit = "spark.gluten.sql.columnar.backend.v
const std::string kSpillPartitionBits = "spark.gluten.sql.columnar.backend.velox.spillPartitionBits";
const std::string kMaxSpillRunRows = "spark.gluten.sql.columnar.backend.velox.MaxSpillRunRows";
const std::string kMaxSpillBytes = "spark.gluten.sql.columnar.backend.velox.MaxSpillBytes";
const std::string kSpillWriteBufferSize = "spark.gluten.sql.columnar.backend.velox.spillWriteBufferSize";
const std::string kSpillReadBufferSize = "spark.unsafe.sorter.spill.reader.buffer.size";
const uint64_t kMaxSpillFileSizeDefault = 1L * 1024 * 1024 * 1024;

Expand Down
18 changes: 7 additions & 11 deletions shims/common/src/main/scala/org/apache/gluten/GlutenConfig.scala
Original file line number Diff line number Diff line change
Expand Up @@ -319,8 +319,6 @@ class GlutenConfig(conf: SQLConf) extends Logging {

def veloxMaxSpillBytes: Long = conf.getConf(COLUMNAR_VELOX_MAX_SPILL_BYTES)

def veloxMaxWriteBufferSize: Long = conf.getConf(COLUMNAR_VELOX_MAX_SPILL_WRITE_BUFFER_SIZE)

def veloxBloomFilterExpectedNumItems: Long =
conf.getConf(COLUMNAR_VELOX_BLOOM_FILTER_EXPECTED_NUM_ITEMS)

Expand Down Expand Up @@ -569,7 +567,9 @@ object GlutenConfig {
val SPARK_OFFHEAP_ENABLED = "spark.memory.offHeap.enabled"
val SPARK_REDACTION_REGEX = "spark.redaction.regex"
val SPARK_UNSAFE_SORTER_SPILL_READER_BUFFER_SIZE = "spark.unsafe.sorter.spill.reader.buffer.size"
val SPARK_UNSAFE_SORTER_SPILL_READER_BUFFER_SIZE_DEFAULT = 1024 * 1024
val SPARK_UNSAFE_SORTER_SPILL_READER_BUFFER_SIZE_DEFAULT: Int = 1024 * 1024
val SPARK_SHUFFLE_SPILL_DISK_WRITE_BUFFER_SIZE = "spark.shuffle.spill.diskWriteBufferSize"
val SPARK_SHUFFLE_SPILL_DISK_WRITE_BUFFER_SIZE_DEFAULT: Int = 1024 * 1024

// For Soft Affinity Scheduling
// Enable Soft Affinity Scheduling, default value is false
Expand Down Expand Up @@ -737,7 +737,10 @@ object GlutenConfig {
GLUTEN_COLUMNAR_TO_ROW_MEM_THRESHOLD.defaultValue.get.toString),
(
SPARK_UNSAFE_SORTER_SPILL_READER_BUFFER_SIZE,
SPARK_UNSAFE_SORTER_SPILL_READER_BUFFER_SIZE_DEFAULT.toString)
SPARK_UNSAFE_SORTER_SPILL_READER_BUFFER_SIZE_DEFAULT.toString),
(
SPARK_SHUFFLE_SPILL_DISK_WRITE_BUFFER_SIZE,
SPARK_SHUFFLE_SPILL_DISK_WRITE_BUFFER_SIZE_DEFAULT.toString)
)
keyWithDefault.forEach(e => nativeConfMap.put(e._1, conf.getOrElse(e._1, e._2)))

Expand Down Expand Up @@ -1591,13 +1594,6 @@ object GlutenConfig {
.bytesConf(ByteUnit.BYTE)
.createWithDefaultString("100G")

val COLUMNAR_VELOX_MAX_SPILL_WRITE_BUFFER_SIZE =
buildConf("spark.gluten.sql.columnar.backend.velox.spillWriteBufferSize")
.internal()
.doc("The maximum write buffer size")
.bytesConf(ByteUnit.BYTE)
.createWithDefaultString("1M")

val MAX_PARTITION_PER_WRITERS_SESSION =
buildConf("spark.gluten.sql.columnar.backend.velox.maxPartitionsPerWritersSession")
.internal()
Expand Down

0 comments on commit f7f6eec

Please sign in to comment.