Skip to content

Commit b8dcc83

Browse files
ENH: Make memory allocation more aggressive on local (#514)
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
1 parent da289d9 commit b8dcc83

File tree

2 files changed

+21
-8
lines changed

2 files changed

+21
-8
lines changed

python/xorbits/_mars/deploy/oscar/local.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,11 @@ def __init__(
217217
oscar_extra_conf=oscar_extra_conf,
218218
)
219219

220+
# make memory allocation policy more aggressive on local by
221+
# assuming all the memory is available.
222+
if self._config.get("scheduling", {}).get("mem_hard_limit", None) is None:
223+
self._config["scheduling"]["mem_hard_limit"] = None
224+
220225
self._bands_to_resource = execution_config.get_deploy_band_resources()
221226
self._supervisor_pool = None
222227
self._worker_pools = []

python/xorbits/_mars/services/scheduling/worker/quota.py

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -415,14 +415,22 @@ async def __post_create__(self):
415415
for band in band_to_resource.keys():
416416
band_config = self._band_configs.get(band[1], self._default_config)
417417
hard_limit = band_config.get("hard_limit")
418-
actor_cls = MemQuotaActor if hard_limit else QuotaActor
419-
self._band_quota_refs[band] = await mo.create_actor(
420-
actor_cls,
421-
band,
422-
**band_config,
423-
uid=MemQuotaActor.gen_uid(band[1]),
424-
address=self.address,
425-
)
418+
if hard_limit:
419+
self._band_quota_refs[band] = await mo.create_actor(
420+
MemQuotaActor,
421+
band,
422+
**band_config,
423+
uid=MemQuotaActor.gen_uid(band[1]),
424+
address=self.address,
425+
)
426+
else:
427+
self._band_quota_refs[band] = await mo.create_actor(
428+
QuotaActor,
429+
band,
430+
quota_size=band_config["quota_size"],
431+
uid=QuotaActor.gen_uid(band[1]),
432+
address=self.address,
433+
)
426434

427435
async def __pre_destroy__(self):
428436
await asyncio.gather(

0 commit comments

Comments
 (0)