Repository: kubernetes-sigs/kueue

Issue:
"Nominate Worker Clusters with Incremental Dispatcher" is constantly logged for all workloads at V3
**What happened**:

This log line is constantly logged for all workloads: "Nominate Worker Clusters with Incremental Dispatcher"

**What you expected to happen**:

Log this line only for: MultiKueue workload which is QuotaReserved (and not Finished etc)

**How to reproduce it (as minimally and precisely as possible)**:


Just see our e2e logs (not for MultiKueue even), eg:

https://storage.googleapis.com/kubernetes-ci-logs/pr-logs/pull/kubernetes-sigs_kueue/7318/pull-kueue-test-e2e-main-1-34/1980552609731186688/artifacts/run-test-e2e-singlecluster-1.34.0/kind-worker2/pods/kueue-system_kueue-controller-manager-74948d5f78-8jhm2_9cd4181b-f4d6-4f03-b951-1eecff8060b6/manager/0.log


**Anything else we need to know?**:

```
2025-10-21T08:49:55.133092469Z stderr F 2025-10-21T08:49:55.132883577Z	LEVEL(-3)	workloaddispatcher/incrementaldispatcher.go:77	Nominate Worker Clusters with Incremental Dispatcher	{"controller": "multikueue_incremental_dispatcher", "controllerGroup": "kueue.x-k8s.io", "controllerKind": "Workload", "Workload": {"name":"job-admission-checked-job-42f2a","namespace":"e2e-metrics-qtdfr"}, "namespace": "e2e-metrics-qtdfr", "name": "job-admission-checked-job-42f2a", "reconcileID": "b8d97723-347d-4740-bee5-f61c4382e49f"}
2025-10-21T08:49:55.133127589Z stderr F 2025-10-21T08:49:55.132932997Z	LEVEL(-3)	workloaddispatcher/incrementaldispatcher.go:80	Not a Incremental Dispatcher, skip the reconciliation	{"controller": "multikueue_incremental_dispatcher", "controllerGroup": "kueue.x-k8s.io", "controllerKind": "Workload", "Workload": {"name":"job-admission-checked-job-42f2a","namespace":"e2e-metrics-qtdfr"}, "namespace": "e2e-metrics-qtdfr", "name": "job-admission-checked-job-42f2a", "reconcileID": "b8d97723-347d-4740-bee5-f61c4382e49f", "dispatcherName": "kueue.x-k8s.io/multikueue-dispatcher-all-at-once"}
```

Hints from issue comments:
@mimowo: cc @mszadkow @mszadkow: /assign@mszadkow: /unassign@mszadkow: /assign

Solution patch:
diff --git a/Makefile-test.mk b/Makefile-test.mk
index d2ec63586..8ef254289 100644
--- a/Makefile-test.mk
+++ b/Makefile-test.mk
@@ -38,7 +38,7 @@ INTEGRATION_OUTPUT_OPTIONS ?= --output-interceptor-mode=none
 
 # Folder where the e2e tests are located.
 E2E_TARGET ?= ./test/e2e/...
-E2E_K8S_VERSIONS ?= 1.31.12 1.32.8 1.33.4 1.34.0
+E2E_K8S_VERSIONS ?= 1.32.8 1.33.4 1.34.0
 E2E_K8S_VERSION ?= 1.34
 E2E_K8S_FULL_VERSION ?= $(filter $(E2E_K8S_VERSION).%,$(E2E_K8S_VERSIONS))
 # Default to E2E_K8S_VERSION.0 if no match is found
diff --git a/README.md b/README.md
index 1e8aa80d9..c62647f2e 100644
--- a/README.md
+++ b/README.md
@@ -38,7 +38,6 @@ Read the [overview](https://kueue.sigs.k8s.io/docs/overview/) and watch the Kueu
   - ✔️ Integration Test [testgrid](https://testgrid.k8s.io/sig-scheduling#periodic-kueue-test-integration-main)
   - ✔️ Integration MultiKueue Tests [testgrid](https://testgrid.k8s.io/sig-scheduling#periodic-kueue-test-integration-multikueue-main)
   - ✔️ E2E Tests for Kubernetes
-    [1.31](https://testgrid.k8s.io/sig-scheduling#periodic-kueue-test-e2e-main-1-31),
     [1.32](https://testgrid.k8s.io/sig-scheduling#periodic-kueue-test-e2e-main-1-32),
     [1.33](https://testgrid.k8s.io/sig-scheduling#periodic-kueue-test-e2e-main-1-33),
     [1.34](https://testgrid.k8s.io/sig-scheduling#periodic-kueue-test-e2e-main-1-34),
diff --git a/keps/2724-topology-aware-scheduling/README.md b/keps/2724-topology-aware-scheduling/README.md
index 421c93cf7..d8baa1d23 100644
--- a/keps/2724-topology-aware-scheduling/README.md
+++ b/keps/2724-topology-aware-scheduling/README.md
@@ -46,6 +46,8 @@
   - [Cross-PodSet Topology Aware scheduling](#cross-podset-topology-aware-scheduling)
     - [Ensure leader and workers end up on the same flavor](#ensure-leader-and-workers-end-up-on-the-same-flavor)
   - [Enforcing the assignment](#enforcing-the-assignment)
+  - [Balanced placement](#balanced-placement)
+    - [Example](#example-2)
   - [Support for ProvisioningRequests](#support-for-provisioningrequests)
     - [Determining the need for second pass](#determining-the-need-for-second-pass)
     - [Targeting the newly provisioned nodes](#targeting-the-newly-provisioned-nodes)
@@ -69,7 +71,7 @@
     - [Rename the topologyAssignment.domains.values field as levelValues](#rename-the-topologyassignmentdomainsvalues-field-as-levelvalues)
   - [Drop dedicated TAS label](#drop-dedicated-tas-label)
   - [MostFreeCapacity algorithm](#mostfreecapacity-algorithm)
-    - [Example](#example-2)
+    - [Example](#example-3)
 <!-- /toc -->
 
 ## Summary
@@ -1038,6 +1040,10 @@ Kueue places pods on domains with different algorithms, depending on the annotat
 - `LeastFreeCapacity` algorithm - Kueue selects as many domains as needed (if it meets user's requirement) starting from the one with the least free capacity;
 - `BestFit` algorithm - Kueue selects as many domains as needed (if it meets user's requirement) starting from the one with the most free capacity.
 However, it optimizes the selection of the last domain at each level to minimize the remaining free resources.
+- `BalancedPlacement` algorithm - Kueue selects as many domains as needed (if it meets user's requirement)
+and places pods evenly on the selected domains. The balanced placement is performed only at two consecutive
+levels, where the higher of these two levels is indicated by the `preferred` annotation
+(for more details see [Balanced placement](#balanced-placement)).
 
 #### Example
 Consider a rack with four nodes that can accommodate 3, 3, 2, and 1 pod, respectively. A PodSet consists of 7 pods.
@@ -1075,6 +1081,7 @@ Since v0.15, the available feature gates are as follows:
 | None <br/> or TASProfileMixed (default)    | BestFit           | BestFit           | LeastFreeCapacity |
 | TASProfileBestFit (deprecated)             | BestFit           | BestFit           | BestFit           |
 | TASProfileLeastFreeCapacity (deprecated)   | LeastFreeCapacity | LeastFreeCapacity | LeastFreeCapacity |
+| TASBalancedPlacement                       | BalancedPlacement | BestFit           | LeastFreeCapacity |
 
 Based on the user feedback, we decided to make `TASProfileMixed` default starting in v0.15. (The corresponding feature gate is hence obsolete; we formally keep it "deprecated" for backwards compatibility). It differs from the previous default only in the `unconstrained` case - in which Kueue should prioritize minimizing fragmentation which is provided by the `LeastFreeCapacity` algorithm.
 
@@ -1173,6 +1180,62 @@ to ungate a Pod. The expectation is fulfilled if the Pod is observed as ungated
 or the ungating request fails. We hold ungating if there are pending ungatings
 within the PodSet.
 
+### Balanced placement
+The balanced placement algorithm provides an alternative to the greedy packing strategies. Instead of iterating over the domains sorted from largest to smallest available space (or based on some other criteria) and trying to pack as many pods as possible to each domain until the request fits, it first finds the optimal set of domains that fit the request and then distributes the pods as evenly as possible across these domains. 
+
+Greedy placement strategies (such as `BestFit` and `LeastFreeCapacity`) might result in a placement with a small
+number of pods assigned to the last considered domain (even though the existing algorithms choose the best possible
+last domain). For example 12 pods distributed among domains with capacities (10,10) will be placed (10,2). However,
+in some applications, a more balanced placement (6,6) would be more efficient. Some examples of such cases would be
+all-to-all communication procedures (e.g. Allgather) since more balanced placement leads to more efficient
+cross-domain traffic.
+
+In the first implemetation, we propose to perform the balanced algorithm only on two consequtive levels indicated
+by the user with the `preferred` flag. Let L be the level indicated by the `preferred` flag. We assume that the
+request must fit within a single domain on level L-1 and otherwise we fallback to the standard algorithm. The above
+assumptions are motivated by the application of the balanced placement algorithm to all-to-all communication
+on the specific networking for GPUs. If the concept of balanced placement would be useful in other contexts it
+would be possible to lift these assumptions. This balancing algorithm is enabled by the `TASBalancedPlacement` feature gate.
+
+The algorithm could be summarized as follows:
+
+```
+1. For each domain on level L-1:
+   - check if the entire request fits on this domain
+   - calculate T, the maximum possible minimum number of pods that would be placed on a domain on level L+1 if the request is placed on this domain.
+2. If no domain on level L-1 fits the entire request, fallback to the standard algorithm.
+3. Otherwise, pick a domain D on level L-1 that 
+   - first maximizes the value of T
+   - secondly minimizes the number of domains that need to be used on level L to fit the request 
+4. Prune every descendant of D with capacity below T.
+5. On level L find an optimal subset of children of D that fit the request:
+   - first minimize the size of the subset
+   - secondly minimize the total capacity of the subset
+   - thirdly maximize entropies of children capacities of the subset
+6. On level L+1 find an optimal subset of children of domains from step 5 that fit the request:
+   - first minimize the size of the subset
+   - secondly minimize the total capacity of the subset
+7. For the subset found in step 6, place the pods by first placing T pods on each domain, and then distribute the rest abritrarily.
+```
+
+The balancing algorithm will support all the job types currently supported by TAS including:
+
+ - JobSet. Instead of assigning pods, the balancing algorithm will assign slices.
+ - LeaderWorkerSet. Will co-locate leader with workers while keeping the overall
+ assignment per node balanced.
+
+#### Example
+For a 3-level topology (block, rack, hostname), in the TopologyRequest, the user specifies `preferred = rack`. Then the balanced placement will find the following assignments:
+
+| Capacities |Request | SliceSize | Assignment | Comment|
+| --- | --- | --- | ----------- | --- |
+| [[15], [15]] | 25| 1 | [[13], [12]] |
+| [[15, 13, 10]] | 23| 1 | [[12, 11, 0]] |
+| [[20, 10], [15, 15]] | 22| 1 | [[0, 0], [11, 11]] | prefer rack that leads to higher value of T
+| [[20, 10], [15, 15]] | 20| 1 | [[20, 0], [0, 0]] |
+| [[10, 5], [5, 5, 5]] | 15|1 |  [[0, 0], [5, 5, 5]] | prefer more balanced rack
+| [[15],[15]] [[15, 15]] | 25 | 1 | [[0],[0]] [[13, 12]] | prefer block where the request fits in a single rack
+| [[15], [15], [15, 15]] | 25|5 |  [[0], [0], [15, 10]] | `podset-slice-required-topology = hostname`
 ### Support for ProvisioningRequests
 
 We are going to support autoscaling via ProvisioningRequest AdmissionCheck.
diff --git a/keps/2724-topology-aware-scheduling/kep.yaml b/keps/2724-topology-aware-scheduling/kep.yaml
index 18db54904..b06fa80b4 100644
--- a/keps/2724-topology-aware-scheduling/kep.yaml
+++ b/keps/2724-topology-aware-scheduling/kep.yaml
@@ -42,6 +42,7 @@ feature-gates:
   - name: TASFailedNodeReplacement
   - name: TASFailedNodeReplacementFailFast
   - name: TASReplaceNodeOnPodTermination
+  - name: TASBalancedPlacement
 disable-supported: true
 
 # The following PRR answers are required at beta release
diff --git a/pkg/cache/scheduler/tas_balanced_placement.go b/pkg/cache/scheduler/tas_balanced_placement.go
new file mode 100644
index 000000000..758aaed60
--- /dev/null
+++ b/pkg/cache/scheduler/tas_balanced_placement.go
@@ -0,0 +1,320 @@
+/*
+Copyright The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package scheduler
+
+import (
+	"maps"
+	"math"
+	"slices"
+
+	utilslices "sigs.k8s.io/kueue/pkg/util/slices"
+)
+
+// evaluateGreedyAssignment simulates placement of a (leaderCount, sliceCount) request on the given domains.
+// It returns whether the request fits, how many domains greedy algorithm uses and what would be the last
+// used domain (with and without leader)
+func evaluateGreedyAssignment(s *TASFlavorSnapshot, domains []*domain, sliceCount int32, leaderCount int32) (bool, int32, *domain, *domain) {
+	var selectedDomainsCount int32
+	var sortedWithoutLeader, sortedWithLeader []*domain
+	var lastDomain, lastDomainWithLeader *domain
+	remainingSliceCount := sliceCount
+	remainingLeaderCount := leaderCount
+	idx := 0
+	if leaderCount > 0 {
+		sortedWithLeader = s.sortedDomainsWithLeader(domains, false)
+		for ; remainingLeaderCount > 0 && idx < len(sortedWithLeader) && sortedWithLeader[idx].leaderState > 0; idx++ {
+			selectedDomainsCount++
+			lastDomainWithLeader = sortedWithLeader[idx]
+			remainingLeaderCount -= sortedWithLeader[idx].leaderState
+			remainingSliceCount -= sortedWithLeader[idx].sliceStateWithLeader
+		}
+		sortedWithoutLeader = s.sortedDomains(sortedWithLeader[idx:], false)
+	} else {
+		sortedWithoutLeader = s.sortedDomains(domains, false)
+	}
+
+	if remainingLeaderCount > 0 {
+		return false, 0, nil, nil
+	}
+
+	for idx = 0; remainingSliceCount > 0 && idx < len(sortedWithoutLeader) && sortedWithoutLeader[idx].sliceState > 0; idx++ {
+		selectedDomainsCount++
+		lastDomain = sortedWithoutLeader[idx]
+		remainingSliceCount -= sortedWithoutLeader[idx].sliceState
+	}
+	if remainingSliceCount > 0 {
+		return false, 0, nil, nil
+	}
+	return true, selectedDomainsCount, lastDomainWithLeader, lastDomain
+}
+
+// The balance threshold value is maximum possible minimum number of slices placed on a domain in a balanced placement solution.
+func balanceThresholdValue(sliceCount int32, selectedDomainsCount int32, lastDomainWithLeader *domain, lastDomain *domain) int32 {
+	threshold := sliceCount / selectedDomainsCount
+	if lastDomainWithLeader != nil {
+		threshold = min(threshold, lastDomainWithLeader.sliceStateWithLeader)
+	}
+	if lastDomain != nil {
+		// TODO: https://github.com/kubernetes-sigs/kueue/issues/7494
+		// we don't have min(threshold, lastDomain.sliceState) here because
+		// later we prune all nodes with sliceStateWithLeader < threshold
+		// while pruning we don't know which node will host the leader
+		// so we have to leave space on each node
+		threshold = min(threshold, lastDomain.sliceStateWithLeader)
+	}
+	return threshold
+}
+
+// selectOptimalDomainSetToFit finds a subset of the provided domains that can accommodate
+// the request (sliceCount, leaderCount). It uses dynamic programming to find a combination
+// of domains that can fit the requested number of leaders and slices, using the minimum number
+// of domains possible (as determined by a greedy assignment) and having the minimum total capacity.
+func selectOptimalDomainSetToFit(s *TASFlavorSnapshot, domains []*domain, sliceCount int32, leaderCount int32, sliceSize int32, priorizeByEntropy bool) []*domain {
+	fit, optimalNumberOfDomains, _, _ := evaluateGreedyAssignment(s, domains, sliceCount, leaderCount)
+	if !fit {
+		return nil
+	}
+
+	if priorizeByEntropy {
+		sortDomainsByCapacityAndEntropy(domains)
+	}
+
+	// domain_placements[i][j][k] stores a list of domains that uses 'i' domains with
+	// ('j' leaders and 'k' workers) left to fit
+	domainPlacements := make([]map[int32]map[int32][]*domain, optimalNumberOfDomains+1)
+	for i := range domainPlacements {
+		domainPlacements[i] = make(map[int32]map[int32][]*domain)
+	}
+	domainPlacements[0][leaderCount] = map[int32][]*domain{sliceCount * sliceSize: {}}
+
+	for _, d := range domains {
+		for i := optimalNumberOfDomains; i > 0; i-- {
+			for _, beforeLeader := range slices.Sorted(maps.Keys(domainPlacements[i-1])) {
+				for _, beforeState := range slices.Sorted(maps.Keys(domainPlacements[i-1][beforeLeader])) {
+					beforePlacement := domainPlacements[i-1][beforeLeader][beforeState]
+					if beforeLeader <= 0 && beforeState <= 0 {
+						continue
+					}
+					newPlacement := make([]*domain, len(beforePlacement), len(beforePlacement)+1)
+					copy(newPlacement, beforePlacement)
+					newPlacement = append(newPlacement, d)
+					// Case 1: Pick this domain with leader
+					if beforeLeader > 0 && d.leaderState > 0 {
+						afterLeader := beforeLeader - d.leaderState
+						afterState := beforeState - d.stateWithLeader
+						if domainPlacements[i][afterLeader] == nil {
+							domainPlacements[i][afterLeader] = make(map[int32][]*domain)
+						}
+						if _, alreadyThere := domainPlacements[i][afterLeader][afterState]; !alreadyThere {
+							domainPlacements[i][afterLeader][afterState] = newPlacement
+						}
+					}
+					// Case 2: Pick this domain without leader
+					if d.sliceState > 0 {
+						afterState := beforeState - d.state
+						if domainPlacements[i][beforeLeader] == nil {
+							domainPlacements[i][beforeLeader] = make(map[int32][]*domain)
+						}
+						if _, alreadyThere := domainPlacements[i][beforeLeader][afterState]; !alreadyThere {
+							domainPlacements[i][beforeLeader][afterState] = newPlacement
+						}
+					}
+				}
+			}
+		}
+	}
+
+	bestLeaderPlacement := domainPlacements[optimalNumberOfDomains][0]
+	bestSlice := int32(-1 << 31) // minus infinity
+	var bestSlicePlacement []*domain
+
+	for _, slicesLeft := range slices.Sorted(maps.Keys(bestLeaderPlacement)) {
+		if slicesLeft > bestSlice && slicesLeft <= 0 {
+			bestSlice = slicesLeft
+			bestSlicePlacement = bestLeaderPlacement[slicesLeft]
+		}
+	}
+	return bestSlicePlacement
+}
+
+func placeSlicesOnDomainsBalanced(s *TASFlavorSnapshot, domains []*domain, sliceCount int32, leaderCount int32, sliceSize int32, threshold int32) ([]*domain, string) {
+	resultDomains := selectOptimalDomainSetToFit(s, domains, sliceCount, leaderCount, sliceSize, false)
+	if resultDomains == nil {
+		return nil, "TAS Balanced Placement: Cannot find optimal domain set to fit the request"
+	}
+	if sliceCount < int32(len(resultDomains))*threshold {
+		return nil, "TAS Balanced Placement: Not enough slices to meet the threshold"
+	}
+	resultDomains = s.sortedDomainsWithLeader(resultDomains, false)
+	extraSlicesLeft := sliceCount - int32(len(resultDomains))*threshold
+	leadersLeft := leaderCount
+	var extraSlicesToTake int32
+	for _, domain := range resultDomains {
+		switch {
+		case leadersLeft > 0:
+			extraSlicesToTake = min(domain.sliceStateWithLeader-threshold, extraSlicesLeft)
+			domain.leaderState = 1
+			leadersLeft--
+		case extraSlicesLeft > 0:
+			extraSlicesToTake = min(domain.sliceState-threshold, extraSlicesLeft)
+			domain.leaderState = 0
+		default:
+			domain.leaderState = 0
+			extraSlicesToTake = 0
+		}
+		domain.state = (threshold + extraSlicesToTake) * sliceSize
+		domain.sliceState = (threshold + extraSlicesToTake)
+		domain.sliceStateWithLeader = domain.sliceState
+		domain.stateWithLeader = domain.state - domain.leaderState
+		extraSlicesLeft -= extraSlicesToTake
+	}
+	if extraSlicesLeft > 0 || leadersLeft > 0 {
+		return nil, "TAS Balanced Placement: Not all slices or leaders could be placed"
+	}
+	return resultDomains, ""
+}
+
+func calculateEntropy(blockSizes []int32) float64 {
+	if len(blockSizes) == 0 {
+		return 0.0
+	}
+
+	var total int32
+	for _, size := range blockSizes {
+		total += size
+	}
+
+	if total == 0 {
+		return 0.0
+	}
+
+	var entropy float64
+	totalF := float64(total)
+	for _, size := range blockSizes {
+		if size > 0 {
+			pI := float64(size) / totalF
+			entropy += -pI * math.Log2(pI)
+		}
+	}
+	return entropy
+}
+
+func sortDomainsByCapacityAndEntropy(domains []*domain) {
+	slices.SortFunc(domains, func(a, b *domain) int {
+		if r := b.leaderState - a.leaderState; r != 0 {
+			return int(r)
+		}
+		if r := b.sliceStateWithLeader - a.sliceStateWithLeader; r != 0 {
+			return int(r)
+		}
+		aChildrenCapacities := utilslices.Map(a.children, func(d **domain) int32 { return (*d).state })
+		bChildrenCapacities := utilslices.Map(b.children, func(d **domain) int32 { return (*d).state })
+		aEntropy := calculateEntropy(aChildrenCapacities)
+		bEntropy := calculateEntropy(bChildrenCapacities)
+		if bEntropy > aEntropy {
+			return 1
+		}
+		if bEntropy < aEntropy {
+			return -1
+		}
+		return 0
+	})
+}
+
+// findBestDomainsForBalancedPlacement evaluates domains for balanced placement.
+// It returns the best set of domains, the balance threshold, and whether a balanced placement is possible.
+func findBestDomainsForBalancedPlacement(s *TASFlavorSnapshot, levelIdx, sliceLevelIdx int, count, leaderCount, sliceSize int32) ([]*domain, int32, bool) {
+	// check if balanced placement is possible: look one level above the preferred level
+	// see if any (single) domain on that level fits the request and compute for each of
+	// them the balance threshold value
+	sliceCount := count / sliceSize
+	var requestedLevelDomainsToConsider [][]*domain
+	if levelIdx == 0 {
+		requestedLevelDomainsToConsider = [][]*domain{slices.Collect(maps.Values(s.domainsPerLevel[0]))}
+	} else {
+		for _, higherLevelDomain := range slices.Collect(maps.Values(s.domainsPerLevel[levelIdx-1])) {
+			requestedLevelDomainsToConsider = append(requestedLevelDomainsToConsider, higherLevelDomain.children)
+		}
+	}
+
+	var bestThreshold int32
+	var bestDomainCountOnRequestedLevel int32
+	var currFitDomain []*domain
+	useBalancedPlacement := false
+
+	for _, requestedLevelSiblingDomains := range requestedLevelDomainsToConsider {
+		lowerLevelDomains := getLowerLevelDomains(s, requestedLevelSiblingDomains, levelIdx, sliceLevelIdx)
+		fits, selectedDomainsCount, lastDomainWithLeader, lastDomain := evaluateGreedyAssignment(s, lowerLevelDomains, sliceCount, leaderCount)
+		if !fits {
+			continue
+		}
+		threshold := balanceThresholdValue(sliceCount, selectedDomainsCount, lastDomainWithLeader, lastDomain)
+		if threshold >= bestThreshold {
+			s.pruneDomainsBelowThreshold(requestedLevelSiblingDomains, threshold, sliceSize, sliceLevelIdx, levelIdx)
+			_, requestedLevelDomainCount, _, _ := evaluateGreedyAssignment(s, requestedLevelSiblingDomains, sliceCount, leaderCount)
+			if threshold > bestThreshold || (threshold == bestThreshold && requestedLevelDomainCount < bestDomainCountOnRequestedLevel) {
+				bestThreshold = threshold
+				bestDomainCountOnRequestedLevel = requestedLevelDomainCount
+				currFitDomain = requestedLevelSiblingDomains
+				useBalancedPlacement = true
+			}
+		}
+	}
+	return currFitDomain, bestThreshold, useBalancedPlacement
+}
+
+// applyBalancedPlacementAlgorithm applies the balanced placement algorithm to determine domain assignments.
+func applyBalancedPlacementAlgorithm(s *TASFlavorSnapshot, levelIdx, sliceLevelIdx int, count, leaderCount, sliceSize, bestThreshold int32, unconstrained bool, currFitDomain []*domain) ([]*domain, string) {
+	sliceCount := count / sliceSize
+	var fitLevelIdx int
+	if levelIdx < sliceLevelIdx {
+		resultDomains := selectOptimalDomainSetToFit(s, currFitDomain, sliceCount, leaderCount, sliceSize, true)
+		if resultDomains == nil {
+			return nil, "TAS Balanced Placement: Cannot find optimal domain set to fit the request"
+		}
+		currFitDomain = s.lowerLevelDomains(resultDomains)
+		fitLevelIdx = levelIdx + 1
+	} else {
+		fitLevelIdx = levelIdx
+	}
+	var reason string
+	currFitDomain, reason = placeSlicesOnDomainsBalanced(s, currFitDomain, sliceCount, leaderCount, sliceSize, bestThreshold)
+	if len(reason) > 0 {
+		return nil, reason
+	}
+	for currentLevelIdx := fitLevelIdx; currentLevelIdx+1 < len(s.domainsPerLevel); currentLevelIdx++ {
+		sliceSizeOnLevel := sliceSize
+		if currentLevelIdx >= sliceLevelIdx {
+			sliceSizeOnLevel = 1
+		}
+		newCurrFitDomain := make([]*domain, 0)
+		for _, domain := range currFitDomain {
+			sortedLowerDomains := s.sortedDomains(domain.children, unconstrained)
+			addCurrFitDomain := s.updateCountsToMinimumGeneric(sortedLowerDomains, domain.state, domain.leaderState, sliceSizeOnLevel, unconstrained, currentLevelIdx < sliceLevelIdx)
+			newCurrFitDomain = append(newCurrFitDomain, addCurrFitDomain...)
+		}
+		currFitDomain = newCurrFitDomain
+	}
+	return currFitDomain, ""
+}
+
+func getLowerLevelDomains(s *TASFlavorSnapshot, domains []*domain, levelIdx, sliceLevelIdx int) []*domain {
+	if levelIdx < sliceLevelIdx {
+		return s.lowerLevelDomains(domains)
+	}
+	return domains
+}
diff --git a/pkg/cache/scheduler/tas_flavor_snapshot.go b/pkg/cache/scheduler/tas_flavor_snapshot.go
index c0e86ba3b..6f5fce89d 100644
--- a/pkg/cache/scheduler/tas_flavor_snapshot.go
+++ b/pkg/cache/scheduler/tas_flavor_snapshot.go
@@ -741,33 +741,50 @@ func (s *TASFlavorSnapshot) findTopologyAssignment(
 
 	// phase 2a: determine the level at which the assignment is done along with
 	// the domains which can accommodate all pods/slices
-	fitLevelIdx, currFitDomain, reason := s.findLevelWithFitDomains(levelIdx, required, count, leaderCount, sliceSize, unconstrained)
-	if len(reason) > 0 {
-		return nil, reason
+	var currFitDomain []*domain
+	var fitLevelIdx int
+	var useBalancedPlacement bool
+	if features.Enabled(features.TASBalancedPlacement) && !required && !unconstrained {
+		var bestThreshold int32
+		currFitDomain, bestThreshold, useBalancedPlacement = findBestDomainsForBalancedPlacement(s, levelIdx, sliceLevelIdx, count, leaderCount, sliceSize)
+
+		if useBalancedPlacement {
+			currFitDomain, reason = applyBalancedPlacementAlgorithm(s, levelIdx, sliceLevelIdx, count, leaderCount, sliceSize, bestThreshold, unconstrained, currFitDomain)
+			if len(reason) > 0 {
+				return nil, reason
+			}
+		}
 	}
 
-	// phase 2b: traverse the tree down level-by-level optimizing the number of
-	// topology domains at each level
-	// if unconstrained is set, we'll only do it once
-	currFitDomain = s.updateCountsToMinimumGeneric(currFitDomain, count, leaderCount, sliceSize, unconstrained, true)
-	for levelIdx := fitLevelIdx; levelIdx+1 < len(s.domainsPerLevel); levelIdx++ {
-		if levelIdx < sliceLevelIdx {
-			// If we are "above" the requested slice topology level, we're greedily assigning pods/slices to
-			// all domains without checking what we've assigned to parent domains.
-			sortedLowerDomains := s.sortedDomains(s.lowerLevelDomains(currFitDomain), unconstrained)
-			currFitDomain = s.updateCountsToMinimumGeneric(sortedLowerDomains, count, leaderCount, sliceSize, unconstrained, true)
-		} else {
-			// If we are "at" or "below" the requested slice topology level, we have to carefully assign pods
-			// to domains based on what we've assigned to parent domains, that's why we're iterating through
-			// each parent domain and assigning `domain.state` amount of pods its child domains.
-			newCurrFitDomain := make([]*domain, 0)
-			for _, domain := range currFitDomain {
-				sortedLowerDomains := s.sortedDomains(domain.children, unconstrained)
-
-				addCurrFitDomain := s.updateCountsToMinimumGeneric(sortedLowerDomains, domain.state, domain.leaderState, 1, unconstrained, false)
-				newCurrFitDomain = append(newCurrFitDomain, addCurrFitDomain...)
+	if !useBalancedPlacement {
+		fitLevelIdx, currFitDomain, reason = s.findLevelWithFitDomains(levelIdx, required, count, leaderCount, sliceSize, unconstrained)
+		if len(reason) > 0 {
+			return nil, reason
+		}
+		// phase 2b: traverse the tree down level-by-level optimizing the number of
+		// topology domains at each level
+		// if unconstrained is set, we'll only do it once
+		currFitDomain = s.updateCountsToMinimumGeneric(currFitDomain, count, leaderCount, sliceSize, unconstrained, true)
+
+		for levelIdx := fitLevelIdx; levelIdx+1 < len(s.domainsPerLevel); levelIdx++ {
+			if levelIdx < sliceLevelIdx {
+				// If we are "above" the requested slice topology level, we're greedily assigning pods/slices to
+				// all domains without checking what we've assigned to parent domains.
+				sortedLowerDomains := s.sortedDomains(s.lowerLevelDomains(currFitDomain), unconstrained)
+				currFitDomain = s.updateCountsToMinimumGeneric(sortedLowerDomains, count, leaderCount, sliceSize, unconstrained, true)
+			} else {
+				// If we are "at" or "below" the requested slice topology level, we have to carefully assign pods
+				// to domains based on what we've assigned to parent domains, that's why we're iterating through
+				// each parent domain and assigning `domain.state` amount of pods its child domains.
+				newCurrFitDomain := make([]*domain, 0)
+				for _, domain := range currFitDomain {
+					sortedLowerDomains := s.sortedDomains(domain.children, unconstrained)
+
+					addCurrFitDomain := s.updateCountsToMinimumGeneric(sortedLowerDomains, domain.state, domain.leaderState, 1, unconstrained, false)
+					newCurrFitDomain = append(newCurrFitDomain, addCurrFitDomain...)
+				}
+				currFitDomain = newCurrFitDomain
 			}
-			currFitDomain = newCurrFitDomain
 		}
 	}
 
@@ -1415,6 +1432,33 @@ func (s *TASFlavorSnapshot) notFitMessage(slicesFitCount, totalRequestsSlicesCou
 	return fmt.Sprintf("topology %q allows to fit only %d out of %d slice(s)", s.topologyName, slicesFitCount, totalRequestsSlicesCount)
 }
 
+func clearState(d *domain) {
+	d.state = int32(0)
+	d.sliceState = int32(0)
+	d.stateWithLeader = int32(0)
+	d.sliceStateWithLeader = int32(0)
+	d.leaderState = int32(0)
+	for _, child := range d.children {
+		clearState(child)
+	}
+}
+
+func (s *TASFlavorSnapshot) pruneDomainsBelowThreshold(domains []*domain, threshold int32, sliceSize int32, sliceLevelIdx int, level int) {
+	for _, d := range domains {
+		for _, c := range d.children {
+			if c.sliceStateWithLeader < threshold {
+				clearState(c)
+			}
+		}
+	}
+	for _, d := range domains {
+		d.state, d.sliceState, d.stateWithLeader, d.sliceStateWithLeader, d.leaderState = s.fillInCountsHelper(d, sliceSize, sliceLevelIdx, level)
+		if d.sliceStateWithLeader < threshold {
+			clearState(d)
+		}
+	}
+}
+
 func slicesRequested(tr *kueue.PodSetTopologyRequest) bool {
 	return tr != nil && tr.PodSetSliceRequiredTopology != nil && tr.PodSetSliceSize != nil
 }
diff --git a/pkg/controller/jobs/job/job_multikueue_adapter.go b/pkg/controller/jobs/job/job_multikueue_adapter.go
index 378709ab2..16dde2d83 100644
--- a/pkg/controller/jobs/job/job_multikueue_adapter.go
+++ b/pkg/controller/jobs/job/job_multikueue_adapter.go
@@ -51,7 +51,7 @@ func (b *multiKueueAdapter) SyncJob(ctx context.Context, localClient client.Clie
 	localJob := batchv1.Job{}
 	err := localClient.Get(ctx, key, &localJob)
 	if err != nil {
-		fmt.Println("PROD: LOCAL JOB ERROR", err, key)
+		log.Error(err, "Failed to get local job", "key", key)
 		return err
 	}
 
diff --git a/pkg/controller/workloaddispatcher/incrementaldispatcher.go b/pkg/controller/workloaddispatcher/incrementaldispatcher.go
index f56bfdbee..0435ba90e 100644
--- a/pkg/controller/workloaddispatcher/incrementaldispatcher.go
+++ b/pkg/controller/workloaddispatcher/incrementaldispatcher.go
@@ -74,7 +74,6 @@ func NewIncrementalDispatcherReconciler(c client.Client, helper *admissioncheck.
 }
 func (r *IncrementalDispatcherReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error) {
 	log := ctrl.LoggerFrom(ctx)
-	log.V(3).Info("Nominate Worker Clusters with Incremental Dispatcher")
 
 	if r.dispatcherName != kueueconfig.MultiKueueDispatcherModeIncremental {
 		log.V(3).Info("Not a Incremental Dispatcher, skip the reconciliation", "dispatcherName", r.dispatcherName)
@@ -126,6 +125,7 @@ func (r *IncrementalDispatcherReconciler) Reconcile(ctx context.Context, req ctr
 		return reconcile.Result{}, nil
 	}
 
+	log.V(3).Info("Nominate Worker Clusters with Incremental Dispatcher")
 	return r.nominateWorkers(ctx, wl, remoteClusters, log)
 }
 
diff --git a/pkg/features/kube_features.go b/pkg/features/kube_features.go
index 52a4794d2..0fe2daffc 100644
--- a/pkg/features/kube_features.go
+++ b/pkg/features/kube_features.go
@@ -164,6 +164,13 @@ const (
 	// This feature gate is going to be replaced by an API before graduation or deprecation.
 	FlavorFungibilityImplicitPreferenceDefault featuregate.Feature = "FlavorFungibilityImplicitPreferenceDefault"
 
+	// owner: @pajakd
+	// kep: https://github.com/kubernetes-sigs/kueue/tree/main/keps/2724-topology-aware-scheduling
+	//
+	// Use balanced placement algorithm in TAS. This feature gate is going to be replaced by an API
+	// before graduation or deprecation.
+	TASBalancedPlacement featuregate.Feature = "TASBalancedPlacement"
+
 	// owner: @alaypatel07
 	// kep: https://github.com/kubernetes-sigs/kueue/tree/main/keps/2941-DRA
 	//
@@ -298,6 +305,9 @@ var defaultVersionedFeatureGates = map[featuregate.Feature]featuregate.Versioned
 	FlavorFungibilityImplicitPreferenceDefault: {
 		{Version: version.MustParse("0.13"), Default: false, PreRelease: featuregate.Alpha},
 	},
+	TASBalancedPlacement: {
+		{Version: version.MustParse("0.15"), Default: false, PreRelease: featuregate.Alpha},
+	},
 	DynamicResourceAllocation: {
 		{Version: version.MustParse("0.14"), Default: false, PreRelease: featuregate.Alpha},
 	},
diff --git a/site/content/en/docs/concepts/topology_aware_scheduling.md b/site/content/en/docs/concepts/topology_aware_scheduling.md
index f697f1433..3cc0f930f 100644
--- a/site/content/en/docs/concepts/topology_aware_scheduling.md
+++ b/site/content/en/docs/concepts/topology_aware_scheduling.md
@@ -239,6 +239,34 @@ The following table summarizes the behavior based on the combination of the feat
 
 We recommend keeping all three feature gates enabled to ensure the fastest feedback loop for workloads affected by node failures.
 
+#### Balanced Placement
+{{< feature-state state="alpha" for_version="v0.15" >}}
+{{% alert title="Note" color="primary" %}}
+`TASBalancedPlacement` is currently an alpha feature and is disabled by default.
+
+You can enable it by editing the `TASBalancedPlacement` feature gate. Refer to the
+[Installation guide](/docs/installation/#change-the-feature-gates-configuration)
+for instructions on configuring feature gates.
+{{% /alert %}}
+
+The balanced placement algorithm provides an alternative to the greedy packing strategies. Instead of
+iterating over the domains sorted from largest to smallest available space (or based on some other criteria)
+and trying to pack as many pods/slices as possible to each domain until the request fits, it first finds the
+optimal set of domains that fit the request and then distributes the pods/slices as evenly as possible across
+these domains.
+
+Greedy placement strategies (such as `BestFit` and `LeastFreeCapacity`) might result in a placement with a small
+number of pods assigned to the last considered domain. For example 12 pods distributed among domains with
+capacities (10,10) will be placed (10,2). However, in some applications, a more balanced placement (6,6) would
+be more efficient. Some examples of such cases would be all-to-all communication procedures (e.g. Allgather)
+since more balanced placement leads to more efficient cross-domain traffic.
+
+To use this feature, use the `kueue.x-k8s.io/podset-preferred-topology` annotation on the Job. Kueue TAS makes 
+sure that the minimum number of pods (or slices) placed on any domain **one level below** the indicated level
+will be maximied. Also (as a second criterion) the number of domains used on the indicated level will be
+minimized. However, if the Job would not fit within a single domain **one level above** the indicated level,
+Kueue will not perform the balanced placement and will fallback to the standard TAS algorithm.
+
 ### Limitations
 
 Currently, there are limitations for the compatibility of TAS with other
diff --git a/site/content/en/docs/tasks/run/multikueue/job.md b/site/content/en/docs/tasks/run/multikueue/job.md
index a1a7e7f8e..1b10ba35a 100644
--- a/site/content/en/docs/tasks/run/multikueue/job.md
+++ b/site/content/en/docs/tasks/run/multikueue/job.md
@@ -13,11 +13,7 @@ Check the [MultiKueue installation guide](/docs/tasks/manage/setup_multikueue) o
 
 For the ease of setup and use we recommend using at least Kueue v0.8.1.
 
-The recommended way of running MultiKueue depends on the configuration of the `JobManagedBy` feature gate in your cluster. 
-
-{{% alert title="Note" color="primary" %}}
-The `JobManagedBy` feature gate is disabled in 1.30 and 1.31 by default, and will be enabled in 1.32 by default.
-{{% /alert %}}
+The recommended way of running MultiKueue depends on the configuration of the `JobManagedBy` feature gate in your cluster.
 
 ### Cluster with JobManagedBy enabled
 
diff --git a/site/content/zh-CN/docs/tasks/run/multikueue/job.md b/site/content/zh-CN/docs/tasks/run/multikueue/job.md
index ac40d8d67..1b228b1b7 100644
--- a/site/content/zh-CN/docs/tasks/run/multikueue/job.md
+++ b/site/content/zh-CN/docs/tasks/run/multikueue/job.md
@@ -14,10 +14,6 @@ description: 运行 MultiKueue 调度的 Kubernetes Job。
 
 运行 MultiKueue 的推荐方式取决于集群中 `JobManagedBy` 特性门控的配置。
 
-{{% alert title="注意" color="primary" %}}
-`JobManagedBy` 特性门控在 Kubernetes v1.30 和 v1.31 版本中默认禁用，在 v1.32 版本中默认启用。
-{{% /alert %}}
-
 ### 集群启用 JobManagedBy {#cluster-with-jobmanagedby-enabled}
 
 当集群启用 `JobManagedBy` 时，建议配置 Kueue 启用 `MultiKueueBatchJobWithManagedBy` 特性门控。



Test patch:
diff --git a/pkg/cache/scheduler/tas_balanced_placement_test.go b/pkg/cache/scheduler/tas_balanced_placement_test.go
new file mode 100644
index 000000000..7892bbe7e
--- /dev/null
+++ b/pkg/cache/scheduler/tas_balanced_placement_test.go
@@ -0,0 +1,169 @@
+/*
+Copyright The Kubernetes Authors.
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+*/
+
+package scheduler
+
+import (
+	"sort"
+	"testing"
+
+	"github.com/google/go-cmp/cmp"
+	"github.com/google/go-cmp/cmp/cmpopts"
+
+	utiltesting "sigs.k8s.io/kueue/pkg/util/testing"
+)
+
+func TestSelectOptimalDomainSetToFit(t *testing.T) {
+	d1 := &domain{id: "d1", state: 9, sliceState: 9, leaderState: 1, stateWithLeader: 8, sliceStateWithLeader: 8}
+	d2 := &domain{id: "d2", state: 6, sliceState: 6, leaderState: 0, stateWithLeader: 6, sliceStateWithLeader: 6}
+	d3 := &domain{id: "d3", state: 4, sliceState: 4, leaderState: 1, stateWithLeader: 3, sliceStateWithLeader: 3}
+	d4 := &domain{id: "d4", state: 2, sliceState: 2, leaderState: 0, stateWithLeader: 2, sliceStateWithLeader: 2}
+
+	testCases := map[string]struct {
+		domains     []*domain
+		workerCount int32
+		leaderCount int32
+		want        []string
+	}{
+		"no fit": {
+			domains:     []*domain{d1, d2, d3, d4},
+			workerCount: 22,
+			leaderCount: 0,
+			want:        []string{},
+		},
+		"simple fit one domain": {
+			domains:     []*domain{d1, d2, d3, d4},
+			workerCount: 5,
+			leaderCount: 1,
+			want:        []string{"d1"},
+		},
+		"perfect fit with two domains": {
+			domains:     []*domain{d1, d2, d3, d4},
+			workerCount: 9,
+			leaderCount: 1,
+			want:        []string{"d2", "d3"},
+		},
+		"perfect fit with two domains 2": {
+			domains:     []*domain{d1, d2, d3, d4},
+			workerCount: 10,
+			leaderCount: 1,
+			want:        []string{"d1", "d4"},
+		},
+		"best fit, single domain": {
+			domains:     []*domain{d1, d2, d3, d4},
+			workerCount: 5,
+			leaderCount: 0,
+			want:        []string{"d2"},
+		},
+	}
+
+	for name, tc := range testCases {
+		t.Run(name, func(t *testing.T) {
+			_, log := utiltesting.ContextWithLog(t)
+			s := newTASFlavorSnapshot(log, "dummy", []string{}, nil)
+			got := selectOptimalDomainSetToFit(s, tc.domains, tc.workerCount, tc.leaderCount, 1, true)
+			gotIDs := make([]string, len(got))
+			for i, d := range got {
+				gotIDs[i] = string(d.id)
+			}
+			sort.Strings(gotIDs)
+			sort.Strings(tc.want)
+			if diff := cmp.Diff(tc.want, gotIDs); diff != "" {
+				t.Errorf("unexpected optimal domain set (-want,+got): %s", diff)
+			}
+		})
+	}
+}
+
+func TestPlaceSlicesOnDomainsBalanced(t *testing.T) {
+	d1 := &domain{id: "d1", state: 18, sliceState: 18, stateWithLeader: 18, leaderState: 0, sliceStateWithLeader: 18}
+	d2 := &domain{id: "d2", state: 18, sliceState: 18, stateWithLeader: 18, leaderState: 0, sliceStateWithLeader: 18}
+	d3 := &domain{id: "d3", state: 18, sliceState: 18, stateWithLeader: 18, leaderState: 0, sliceStateWithLeader: 18}
+	d4 := &domain{id: "d4", state: 10, sliceState: 10, stateWithLeader: 10, leaderState: 0, sliceStateWithLeader: 10}
+	d5 := &domain{id: "d5", state: 2, sliceState: 2, stateWithLeader: 2, leaderState: 0, sliceStateWithLeader: 2}
+
+	testCases := map[string]struct {
+		domains     []*domain
+		sliceCount  int32
+		leaderCount int32
+		sliceSize   int32
+		threshold   int32
+		want        []*domain
+	}{
+		"simple balanced placement on two domains": {
+			domains:     []*domain{d1, d2, d3},
+			sliceCount:  20,
+			leaderCount: 0,
+			sliceSize:   1,
+			threshold:   10,
+			want: []*domain{
+				{id: "d1", sliceState: 10, state: 10, stateWithLeader: 10, sliceStateWithLeader: 10, leaderState: 0},
+				{id: "d2", sliceState: 10, state: 10, stateWithLeader: 10, sliceStateWithLeader: 10, leaderState: 0},
+			},
+		},
+		"simple placement on three domains": {
+			domains:     []*domain{d1, d2, d3},
+			sliceCount:  40,
+			leaderCount: 0,
+			sliceSize:   1,
+			threshold:   13,
+			want: []*domain{
+				{id: "d1", sliceState: 14, state: 14, stateWithLeader: 14, sliceStateWithLeader: 14, leaderState: 0},
+				{id: "d2", sliceState: 13, state: 13, stateWithLeader: 13, sliceStateWithLeader: 13, leaderState: 0},
+				{id: "d3", sliceState: 13, state: 13, stateWithLeader: 13, sliceStateWithLeader: 13, leaderState: 0},
+			},
+		},
+		"find smallest domain that fits": {
+			domains:     []*domain{d1, d2, d3, d4, d5},
+			sliceCount:  2,
+			leaderCount: 0,
+			sliceSize:   1,
+			threshold:   2,
+			want: []*domain{
+				{id: "d5", sliceState: 2, state: 2, stateWithLeader: 2, sliceStateWithLeader: 2, leaderState: 0},
+			},
+		},
+		"correctly select domains": {
+			domains:     []*domain{d1, d2, d3, d4, d5},
+			sliceCount:  25,
+			leaderCount: 0,
+			sliceSize:   1,
+			threshold:   10,
+			want: []*domain{
+				{id: "d1", sliceState: 15, state: 15, stateWithLeader: 15, sliceStateWithLeader: 15, leaderState: 0},
+				{id: "d4", sliceState: 10, state: 10, stateWithLeader: 10, sliceStateWithLeader: 10, leaderState: 0},
+			},
+		},
+	}
+
+	for name, tc := range testCases {
+		t.Run(name, func(t *testing.T) {
+			domains := make([]*domain, len(tc.domains))
+			_, log := utiltesting.ContextWithLog(t)
+			s := newTASFlavorSnapshot(log, "dummy", []string{}, nil)
+			for i, d := range tc.domains {
+				clone := *d
+				domains[i] = &clone
+			}
+
+			got, _ := placeSlicesOnDomainsBalanced(s, domains, tc.sliceCount, tc.leaderCount, tc.sliceSize, tc.threshold)
+
+			if diff := cmp.Diff(tc.want, got, cmp.AllowUnexported(domain{}), cmpopts.IgnoreFields(domain{}, "parent", "children", "levelValues"), cmpopts.SortSlices(func(a, b *domain) bool { return a.id < b.id })); diff != "" {
+				t.Errorf("Unexpected domains (-want,+got):\n%s", diff)
+			}
+		})
+	}
+}
diff --git a/pkg/cache/scheduler/tas_cache_test.go b/pkg/cache/scheduler/tas_cache_test.go
index 8e003b546..586dcb972 100644
--- a/pkg/cache/scheduler/tas_cache_test.go
+++ b/pkg/cache/scheduler/tas_cache_test.go
@@ -50,8 +50,9 @@ type PodSetTestCase struct {
 
 func TestFindTopologyAssignments(t *testing.T) {
 	const (
-		tasBlockLabel = "cloud.com/topology-block"
-		tasRackLabel  = "cloud.com/topology-rack"
+		tasBlockLabel    = "cloud.com/topology-block"
+		tasRackLabel     = "cloud.com/topology-rack"
+		tasSubBlockLabel = "cloud.com/topology-subblock"
 	)
 
 	//      b1                   b2
@@ -2786,6 +2787,1452 @@ func TestFindTopologyAssignments(t *testing.T) {
 				},
 			}},
 		},
+		//         b1
+		//       /  |
+		//     r1   r2
+		//    /     |
+		// x1:15   x2:15
+		// request: 25
+		// expected outcome: x1:13, x2:12
+		"balanced placement; basic": {
+			enableFeatureGates: []featuregate.Feature{features.TASBalancedPlacement},
+			nodes: []corev1.Node{
+				*testingnode.MakeNode("b1-r1-x1").
+					Label(tasBlockLabel, "b1").
+					Label(tasRackLabel, "r1").
+					Label(corev1.LabelHostname, "x1").
+					StatusAllocatable(corev1.ResourceList{
+						"example.com/gpu":   resource.MustParse("15"),
+						corev1.ResourcePods: resource.MustParse("25"),
+					}).
+					Ready().
+					Obj(),
+				*testingnode.MakeNode("b1-r2-x2").
+					Label(tasBlockLabel, "b1").
+					Label(tasRackLabel, "r2").
+					Label(corev1.LabelHostname, "x2").
+					StatusAllocatable(corev1.ResourceList{
+						"example.com/gpu":   resource.MustParse("15"),
+						corev1.ResourcePods: resource.MustParse("25"),
+					}).
+					Ready().
+					Obj(),
+			},
+			levels: defaultThreeLevels,
+			podSets: []PodSetTestCase{{
+				topologyRequest: &kueue.PodSetTopologyRequest{
+					Preferred: ptr.To(tasRackLabel),
+				},
+				requests: resources.Requests{
+					"example.com/gpu": 1,
+				},
+				count: 25,
+				wantAssignment: &kueue.TopologyAssignment{
+					Levels: defaultOneLevel,
+					Domains: []kueue.TopologyDomainAssignment{
+						{
+							Count:  13,
+							Values: []string{"x1"},
+						},
+						{
+							Count:  12,
+							Values: []string{"x2"},
+						},
+					},
+				},
+			}},
+		},
+		//        b1
+		//         |
+		//        r1
+		//    /    |    \
+		// x1:15, x2:13, x3:10
+		// request: 23
+		// expected outcome: x1:12, x2:11
+		"balanced placement; select optmial set of domains": {
+			enableFeatureGates: []featuregate.Feature{features.TASBalancedPlacement},
+			nodes: []corev1.Node{
+				*testingnode.MakeNode("b1-r1-x1").
+					Label(tasBlockLabel, "b1").
+					Label(tasRackLabel, "r1").
+					Label(corev1.LabelHostname, "x1").
+					StatusAllocatable(corev1.ResourceList{
+						"example.com/gpu":   resource.MustParse("15"),
+						corev1.ResourcePods: resource.MustParse("23"),
+					}).
+					Ready().
+					Obj(),
+				*testingnode.MakeNode("b1-r1-x2").
+					Label(tasBlockLabel, "b1").
+					Label(tasRackLabel, "r1").
+					Label(corev1.LabelHostname, "x2").
+					StatusAllocatable(corev1.ResourceList{
+						"example.com/gpu":   resource.MustParse("13"),
+						corev1.ResourcePods: resource.MustParse("23"),
+					}).
+					Ready().
+					Obj(),
+				*testingnode.MakeNode("b1-r1-x3").
+					Label(tasBlockLabel, "b1").
+					Label(tasRackLabel, "r1").
+					Label(corev1.LabelHostname, "x3").
+					StatusAllocatable(corev1.ResourceList{
+						"example.com/gpu":   resource.MustParse("10"),
+						corev1.ResourcePods: resource.MustParse("23"),
+					}).
+					Ready().
+					Obj(),
+			},
+			levels: defaultThreeLevels,
+			podSets: []PodSetTestCase{{
+				topologyRequest: &kueue.PodSetTopologyRequest{
+					Preferred: ptr.To(tasRackLabel),
+				},
+				requests: resources.Requests{
+					"example.com/gpu": 1,
+				},
+				count: 23,
+				wantAssignment: &kueue.TopologyAssignment{
+					Levels: defaultOneLevel,
+					Domains: []kueue.TopologyDomainAssignment{
+						{
+							Count:  12,
+							Values: []string{"x1"},
+						},
+						{
+							Count:  11,
+							Values: []string{"x2"},
+						},
+					},
+				},
+			}},
+		},
+		//        b1
+		//         |
+		//        r1
+		//    /    |    \
+		// x1:20, x2:15, x3:10
+		// request: 25
+		// sliceSize: 5
+		// expected outcome: x2:15, x3:10
+		"balanced placement; select optmial set of domains; with slices": {
+			enableFeatureGates: []featuregate.Feature{features.TASBalancedPlacement},
+			nodes: []corev1.Node{
+				*testingnode.MakeNode("b1-r1-x1").
+					Label(tasBlockLabel, "b1").
+					Label(tasRackLabel, "r1").
+					Label(corev1.LabelHostname, "x1").
+					StatusAllocatable(corev1.ResourceList{
+						"example.com/gpu":   resource.MustParse("20"),
+						corev1.ResourcePods: resource.MustParse("25"),
+					}).
+					Ready().
+					Obj(),
+				*testingnode.MakeNode("b1-r1-x2").
+					Label(tasBlockLabel, "b1").
+					Label(tasRackLabel, "r1").
+					Label(corev1.LabelHostname, "x2").
+					StatusAllocatable(corev1.ResourceList{
+						"example.com/gpu":   resource.MustParse("15"),
+						corev1.ResourcePods: resource.MustParse("25"),
+					}).
+					Ready().
+					Obj(),
+				*testingnode.MakeNode("b1-r1-x3").
+					Label(tasBlockLabel, "b1").
+					Label(tasRackLabel, "r1").
+					Label(corev1.LabelHostname, "x3").
+					StatusAllocatable(corev1.ResourceList{
+						"example.com/gpu":   resource.MustParse("10"),
+						corev1.ResourcePods: resource.MustParse("25"),
+					}).
+					Ready().
+					Obj(),
+			},
+			levels: defaultThreeLevels,
+			podSets: []PodSetTestCase{{
+				topologyRequest: &kueue.PodSetTopologyRequest{
+					Preferred:                   ptr.To(tasRackLabel),
+					PodSetSliceSize:             ptr.To(int32(5)),
+					PodSetSliceRequiredTopology: ptr.To(corev1.LabelHostname),
+				},
+				requests: resources.Requests{
+					"example.com/gpu": 1,
+				},
+				count: 25,
+				wantAssignment: &kueue.TopologyAssignment{
+					Levels: defaultOneLevel,
+					Domains: []kueue.TopologyDomainAssignment{
+						{
+							Count:  15,
+							Values: []string{"x2"},
+						},
+						{
+							Count:  10,
+							Values: []string{"x3"},
+						},
+					},
+				},
+			}},
+		},
+		//         b1      b2
+		//         |       |
+		//        r1        r2
+		//    /     |      |    \
+		// x1:20   x2:10  x3:15   x4:15
+		// request: 22
+		// expected outcome: x3:11, x4:11
+		"balanced placement; select correct block": {
+			enableFeatureGates: []featuregate.Feature{features.TASBalancedPlacement},
+			nodes: []corev1.Node{
+				*testingnode.MakeNode("b1-r1-x1").
+					Label(tasBlockLabel, "b1").
+					Label(tasRackLabel, "r1").
+					Label(corev1.LabelHostname, "x1").
+					StatusAllocatable(corev1.ResourceList{
+						"example.com/gpu":   resource.MustParse("20"),
+						corev1.ResourcePods: resource.MustParse("22"),
+					}).
+					Ready().
+					Obj(),
+				*testingnode.MakeNode("b1-r1-x2").
+					Label(tasBlockLabel, "b1").
+					Label(tasRackLabel, "r1").
+					Label(corev1.LabelHostname, "x2").
+					StatusAllocatable(corev1.ResourceList{
+						"example.com/gpu":   resource.MustParse("10"),
+						corev1.ResourcePods: resource.MustParse("22"),
+					}).
+					Ready().
+					Obj(),
+				*testingnode.MakeNode("b2-r2-x3").
+					Label(tasBlockLabel, "b2").
+					Label(tasRackLabel, "r2").
+					Label(corev1.LabelHostname, "x3").
+					StatusAllocatable(corev1.ResourceList{
+						"example.com/gpu":   resource.MustParse("15"),
+						corev1.ResourcePods: resource.MustParse("22"),
+					}).
+					Ready().
+					Obj(),
+				*testingnode.MakeNode("b2-r2-x4").
+					Label(tasBlockLabel, "b2").
+					Label(tasRackLabel, "r2").
+					Label(corev1.LabelHostname, "x4").
+					StatusAllocatable(corev1.ResourceList{
+						"example.com/gpu":   resource.MustParse("15"),
+						corev1.ResourcePods: resource.MustParse("22"),
+					}).
+					Ready().
+					Obj(),
+			},
+			levels: defaultThreeLevels,
+			podSets: []PodSetTestCase{{
+				topologyRequest: &kueue.PodSetTopologyRequest{
+					Preferred:       ptr.To(tasRackLabel),
+					PodSetSliceSize: ptr.To(int32(1)),
+				},
+				requests: resources.Requests{
+					"example.com/gpu": 1,
+				},
+				count: 22,
+				wantAssignment: &kueue.TopologyAssignment{
+					Levels: defaultOneLevel,
+					Domains: []kueue.TopologyDomainAssignment{
+						{
+							Count:  11,
+							Values: []string{"x3"},
+						},
+						{
+							Count:  11,
+							Values: []string{"x4"},
+						},
+					},
+				},
+			}},
+		},
+		//         b1      b2
+		//         |       |
+		//        r1        r2
+		//    /     |      |    \
+		// x1:14   x2:11  x3:15   x4:10
+		// request: 25
+		// expected outcome: x1:14, x2:11
+		"balanced placement; cannot chose domains from different blocks": {
+			enableFeatureGates: []featuregate.Feature{features.TASBalancedPlacement},
+			nodes: []corev1.Node{
+				*testingnode.MakeNode("b1-r1-x1").
+					Label(tasBlockLabel, "b1").
+					Label(tasRackLabel, "r1").
+					Label(corev1.LabelHostname, "x1").
+					StatusAllocatable(corev1.ResourceList{
+						"example.com/gpu":   resource.MustParse("14"),
+						corev1.ResourcePods: resource.MustParse("25"),
+					}).
+					Ready().
+					Obj(),
+				*testingnode.MakeNode("b1-r1-x2").
+					Label(tasBlockLabel, "b1").
+					Label(tasRackLabel, "r1").
+					Label(corev1.LabelHostname, "x2").
+					StatusAllocatable(corev1.ResourceList{
+						"example.com/gpu":   resource.MustParse("11"),
+						corev1.ResourcePods: resource.MustParse("25"),
+					}).
+					Ready().
+					Obj(),
+				*testingnode.MakeNode("b2-r2-x3").
+					Label(tasBlockLabel, "b2").
+					Label(tasRackLabel, "r2").
+					Label(corev1.LabelHostname, "x3").
+					StatusAllocatable(corev1.ResourceList{
+						"example.com/gpu":   resource.MustParse("15"),
+						corev1.ResourcePods: resource.MustParse("25"),
+					}).
+					Ready().
+					Obj(),
+				*testingnode.MakeNode("b2-r2-x4").
+					Label(tasBlockLabel, "b2").
+					Label(tasRackLabel, "r2").
+					Label(corev1.LabelHostname, "x4").
+					StatusAllocatable(corev1.ResourceList{
+						"example.com/gpu":   resource.MustParse("10"),
+						corev1.ResourcePods: resource.MustParse("25"),
+					}).
+					Ready().
+					Obj(),
+			},
+			levels: defaultThreeLevels,
+			podSets: []PodSetTestCase{{
+				topologyRequest: &kueue.PodSetTopologyRequest{
+					Preferred:       ptr.To(tasRackLabel),
+					PodSetSliceSize: ptr.To(int32(1)),
+				},
+				requests: resources.Requests{
+					"example.com/gpu": 1,
+				},
+				count: 25,
+				wantAssignment: &kueue.TopologyAssignment{
+					Levels: defaultOneLevel,
+					Domains: []kueue.TopologyDomainAssignment{
+						{
+							Count:  14,
+							Values: []string{"x1"},
+						},
+						{
+							Count:  11,
+							Values: []string{"x2"},
+						},
+					},
+				},
+			}},
+		},
+		//          b1     b2
+		//        / |      |
+		//     r1   r2     r3
+		//    /     |      |    \
+		// x1:15   x2:15  x3:15   x4:15
+		// request: 25
+		// sizeSize: 5
+		// expected outcome: x3:15, x4:10
+		"balanced placement; select correct block; prefer blocks with single rack; with slices": {
+			enableFeatureGates: []featuregate.Feature{features.TASBalancedPlacement},
+			nodes: []corev1.Node{
+				*testingnode.MakeNode("b1-r1-x1").
+					Label(tasBlockLabel, "b1").
+					Label(tasRackLabel, "r1").
+					Label(corev1.LabelHostname, "x1").
+					StatusAllocatable(corev1.ResourceList{
+						"example.com/gpu":   resource.MustParse("15"),
+						corev1.ResourcePods: resource.MustParse("25"),
+					}).
+					Ready().
+					Obj(),
+				*testingnode.MakeNode("b1-r2-x2").
+					Label(tasBlockLabel, "b1").
+					Label(tasRackLabel, "r2").
+					Label(corev1.LabelHostname, "x2").
+					StatusAllocatable(corev1.ResourceList{
+						"example.com/gpu":   resource.MustParse("15"),
+						corev1.ResourcePods: resource.MustParse("25"),
+					}).
+					Ready().
+					Obj(),
+				*testingnode.MakeNode("b1-r3-x3").
+					Label(tasBlockLabel, "b1").
+					Label(tasRackLabel, "r3").
+					Label(corev1.LabelHostname, "x3").
+					StatusAllocatable(corev1.ResourceList{
+						"example.com/gpu":   resource.MustParse("15"),
+						corev1.ResourcePods: resource.MustParse("25"),
+					}).
+					Ready().
+					Obj(),
+				*testingnode.MakeNode("b1-r3-x4").
+					Label(tasBlockLabel, "b1").
+					Label(tasRackLabel, "r3").
+					Label(corev1.LabelHostname, "x4").
+					StatusAllocatable(corev1.ResourceList{
+						"example.com/gpu":   resource.MustParse("15"),
+						corev1.ResourcePods: resource.MustParse("25"),
+					}).
+					Ready().
+					Obj(),
+			},
+			levels: defaultThreeLevels,
+			podSets: []PodSetTestCase{{
+				topologyRequest: &kueue.PodSetTopologyRequest{
+					Preferred:                   ptr.To(tasRackLabel),
+					PodSetSliceSize:             ptr.To(int32(5)),
+					PodSetSliceRequiredTopology: ptr.To(corev1.LabelHostname),
+				},
+				requests: resources.Requests{
+					"example.com/gpu": 1,
+				},
+				count: 25,
+				wantAssignment: &kueue.TopologyAssignment{
+					Levels: defaultOneLevel,
+					Domains: []kueue.TopologyDomainAssignment{
+						{
+							Count:  15,
+							Values: []string{"x3"},
+						},
+						{
+							Count:  10,
+							Values: []string{"x4"},
+						},
+					},
+				},
+			}},
+		},
+		//           b1
+		//         /     \
+		//        sb1     sb2
+		//      /   |      |   \
+		//     r1   r2     r3   r4
+		//    /     |      |     |     \
+		// x1:18   x2:8    x3:15 x4:9  x5:7
+		// request: 20
+		// sliceSize: 2
+		// expected outcome: x3:10, x4:8, x5:2
+		"balanced placement; four level topology; slice two levels below balanced level": {
+			enableFeatureGates: []featuregate.Feature{features.TASBalancedPlacement},
+			nodes: []corev1.Node{
+				*testingnode.MakeNode("b1-sb1-r1-x1").
+					Label(tasBlockLabel, "b1").
+					Label(tasSubBlockLabel, "sb1").
+					Label(tasRackLabel, "r1").
+					Label(corev1.LabelHostname, "x1").
+					StatusAllocatable(corev1.ResourceList{
+						"example.com/gpu":   resource.MustParse("18"),
+						corev1.ResourcePods: resource.MustParse("20"),
+					}).
+					Ready().
+					Obj(),
+				*testingnode.MakeNode("b1-sb1-r2-x2").
+					Label(tasBlockLabel, "b1").
+					Label(tasSubBlockLabel, "sb1").
+					Label(tasRackLabel, "r2").
+					Label(corev1.LabelHostname, "x2").
+					StatusAllocatable(corev1.ResourceList{
+						"example.com/gpu":   resource.MustParse("8"),
+						corev1.ResourcePods: resource.MustParse("20"),
+					}).
+					Ready().
+					Obj(),
+				*testingnode.MakeNode("b1-sb1-r3-x3").
+					Label(tasBlockLabel, "b1").
+					Label(tasSubBlockLabel, "sb2").
+					Label(tasRackLabel, "r3").
+					Label(corev1.LabelHostname, "x3").
+					StatusAllocatable(corev1.ResourceList{
+						"example.com/gpu":   resource.MustParse("15"),
+						corev1.ResourcePods: resource.MustParse("20"),
+					}).
+					Ready().
+					Obj(),
+				*testingnode.MakeNode("b1-sb1-r3-x4").
+					Label(tasBlockLabel, "b1").
+					Label(tasSubBlockLabel, "sb2").
+					Label(tasRackLabel, "r4").
+					Label(corev1.LabelHostname, "x4").
+					StatusAllocatable(corev1.ResourceList{
+						"example.com/gpu":   resource.MustParse("9"),
+						corev1.ResourcePods: resource.MustParse("20"),
+					}).
+					Ready().
+					Obj(),
+				*testingnode.MakeNode("b1-sb1-r3-x5").
+					Label(tasBlockLabel, "b1").
+					Label(tasSubBlockLabel, "sb2").
+					Label(tasRackLabel, "r4").
+					Label(corev1.LabelHostname, "x5").
+					StatusAllocatable(corev1.ResourceList{
+						"example.com/gpu":   resource.MustParse("7"),
+						corev1.ResourcePods: resource.MustParse("20"),
+					}).
+					Ready().
+					Obj(),
+			},
+			levels: []string{tasBlockLabel, tasSubBlockLabel, tasRackLabel, corev1.LabelHostname},
+			podSets: []PodSetTestCase{{
+				topologyRequest: &kueue.PodSetTopologyRequest{
+					Preferred:                   ptr.To(string(tasSubBlockLabel)),
+					PodSetSliceSize:             ptr.To(int32(2)),
+					PodSetSliceRequiredTopology: ptr.To(corev1.LabelHostname),
+				},
+				requests: resources.Requests{
+					"example.com/gpu": 1,
+				},
+				count: 20,
+				wantAssignment: &kueue.TopologyAssignment{
+					Levels: []string{corev1.LabelHostname},
+					Domains: []kueue.TopologyDomainAssignment{
+						{
+							Count:  10,
+							Values: []string{"x3"},
+						},
+						{
+							Count:  8,
+							Values: []string{"x4"},
+						},
+						{
+							Count:  2,
+							Values: []string{"x5"},
+						},
+					},
+				},
+			}},
+		},
+		//           b1
+		//         /     \
+		//        sb1     sb2
+		//      /   |      |   \
+		//     r1   r2     r3   r4
+		//    /     |      |     |     \
+		// x1:18   x2:8    x3:15 x4:9  x5:7
+		// request: 20
+		// expected outcome: x3:10, x4:3, x5:7
+		"balanced placement; four level topology; slice one level below balanced level": {
+			enableFeatureGates: []featuregate.Feature{features.TASBalancedPlacement},
+			nodes: []corev1.Node{
+				*testingnode.MakeNode("b1-sb1-r1-x1").
+					Label(tasBlockLabel, "b1").
+					Label(tasSubBlockLabel, "sb1").
+					Label(tasRackLabel, "r1").
+					Label(corev1.LabelHostname, "x1").
+					StatusAllocatable(corev1.ResourceList{
+						"example.com/gpu":   resource.MustParse("18"),
+						corev1.ResourcePods: resource.MustParse("20"),
+					}).
+					Ready().
+					Obj(),
+				*testingnode.MakeNode("b1-sb1-r2-x2").
+					Label(tasBlockLabel, "b1").
+					Label(tasSubBlockLabel, "sb1").
+					Label(tasRackLabel, "r2").
+					Label(corev1.LabelHostname, "x2").
+					StatusAllocatable(corev1.ResourceList{
+						"example.com/gpu":   resource.MustParse("8"),
+						corev1.ResourcePods: resource.MustParse("20"),
+					}).
+					Ready().
+					Obj(),
+				*testingnode.MakeNode("b1-sb1-r3-x3").
+					Label(tasBlockLabel, "b1").
+					Label(tasSubBlockLabel, "sb2").
+					Label(tasRackLabel, "r3").
+					Label(corev1.LabelHostname, "x3").
+					StatusAllocatable(corev1.ResourceList{
+						"example.com/gpu":   resource.MustParse("15"),
+						corev1.ResourcePods: resource.MustParse("20"),
+					}).
+					Ready().
+					Obj(),
+				*testingnode.MakeNode("b1-sb1-r3-x4").
+					Label(tasBlockLabel, "b1").
+					Label(tasSubBlockLabel, "sb2").
+					Label(tasRackLabel, "r4").
+					Label(corev1.LabelHostname, "x4").
+					StatusAllocatable(corev1.ResourceList{
+						"example.com/gpu":   resource.MustParse("9"),
+						corev1.ResourcePods: resource.MustParse("20"),
+					}).
+					Ready().
+					Obj(),
+				*testingnode.MakeNode("b1-sb1-r3-x5").
+					Label(tasBlockLabel, "b1").
+					Label(tasSubBlockLabel, "sb2").
+					Label(tasRackLabel, "r4").
+					Label(corev1.LabelHostname, "x5").
+					StatusAllocatable(corev1.ResourceList{
+						"example.com/gpu":   resource.MustParse("7"),
+						corev1.ResourcePods: resource.MustParse("20"),
+					}).
+					Ready().
+					Obj(),
+			},
+			levels: []string{tasBlockLabel, tasSubBlockLabel, tasRackLabel, corev1.LabelHostname},
+			podSets: []PodSetTestCase{{
+				topologyRequest: &kueue.PodSetTopologyRequest{
+					Preferred:                   ptr.To(string(tasSubBlockLabel)),
+					PodSetSliceSize:             ptr.To(int32(2)),
+					PodSetSliceRequiredTopology: ptr.To(tasRackLabel),
+				},
+				requests: resources.Requests{
+					"example.com/gpu": 1,
+				},
+				count: 20,
+				wantAssignment: &kueue.TopologyAssignment{
+					Levels: []string{corev1.LabelHostname},
+					Domains: []kueue.TopologyDomainAssignment{
+						{
+							Count:  10,
+							Values: []string{"x3"},
+						},
+						{
+							Count:  3,
+							Values: []string{"x4"},
+						},
+						{
+							Count:  7,
+							Values: []string{"x5"},
+						},
+					},
+				},
+			}},
+		},
+		//           b1
+		//         /     \
+		//        sb1     sb2
+		//      /   |      | \
+		//     r1   r2     r3 r4
+		//    /     |      |     \
+		// x1:18   x2:8    x3:15 x4:15
+		// request: 20
+		// sliceSize: 2
+		// expected outcome: x3:10, x4:10
+		"balanced placement; four level topology; balance on rack level; slice not on the lowest level": {
+			enableFeatureGates: []featuregate.Feature{features.TASBalancedPlacement},
+			nodes: []corev1.Node{
+				*testingnode.MakeNode("b1-sb1-r1-x1").
+					Label(tasBlockLabel, "b1").
+					Label(tasSubBlockLabel, "sb1").
+					Label(tasRackLabel, "r1").
+					Label(corev1.LabelHostname, "x1").
+					StatusAllocatable(corev1.ResourceList{
+						"example.com/gpu":   resource.MustParse("18"),
+						corev1.ResourcePods: resource.MustParse("20"),
+					}).
+					Ready().
+					Obj(),
+				*testingnode.MakeNode("b1-sb1-r2-x2").
+					Label(tasBlockLabel, "b1").
+					Label(tasSubBlockLabel, "sb1").
+					Label(tasRackLabel, "r2").
+					Label(corev1.LabelHostname, "x2").
+					StatusAllocatable(corev1.ResourceList{
+						"example.com/gpu":   resource.MustParse("8"),
+						corev1.ResourcePods: resource.MustParse("20"),
+					}).
+					Ready().
+					Obj(),
+				*testingnode.MakeNode("b1-sb1-r3-x3").
+					Label(tasBlockLabel, "b1").
+					Label(tasSubBlockLabel, "sb2").
+					Label(tasRackLabel, "r3").
+					Label(corev1.LabelHostname, "x3").
+					StatusAllocatable(corev1.ResourceList{
+						"example.com/gpu":   resource.MustParse("15"),
+						corev1.ResourcePods: resource.MustParse("20"),
+					}).
+					Ready().
+					Obj(),
+				*testingnode.MakeNode("b1-sb1-r3-x4").
+					Label(tasBlockLabel, "b1").
+					Label(tasSubBlockLabel, "sb2").
+					Label(tasRackLabel, "r4").
+					Label(corev1.LabelHostname, "x4").
+					StatusAllocatable(corev1.ResourceList{
+						"example.com/gpu":   resource.MustParse("15"),
+						corev1.ResourcePods: resource.MustParse("20"),
+					}).
+					Ready().
+					Obj(),
+			},
+			levels: []string{tasBlockLabel, tasSubBlockLabel, tasRackLabel},
+			podSets: []PodSetTestCase{{
+				topologyRequest: &kueue.PodSetTopologyRequest{
+					Preferred:                   ptr.To(string(tasSubBlockLabel)),
+					PodSetSliceSize:             ptr.To(int32(2)),
+					PodSetSliceRequiredTopology: ptr.To(tasRackLabel),
+				},
+				requests: resources.Requests{
+					"example.com/gpu": 1,
+				},
+				count: 20,
+				wantAssignment: &kueue.TopologyAssignment{
+					Levels: []string{tasBlockLabel, tasSubBlockLabel, tasRackLabel},
+					Domains: []kueue.TopologyDomainAssignment{
+						{
+							Count:  10,
+							Values: []string{"b1", "sb2", "r3"},
+						},
+						{
+							Count:  10,
+							Values: []string{"b1", "sb2", "r4"},
+						},
+					},
+				},
+			}},
+		},
+		//        b1
+		//         |        \
+		//        r1             r2
+		//    /    |    \         |     \
+		// x1:15, x2:13, x3:10   x4:20   x5:8
+		// request: 22
+		// sliceSize: 2
+		// expected outcome: x2:12, x3:10
+		"balanced placement; three level topology; balance on the same level as slice": {
+			enableFeatureGates: []featuregate.Feature{features.TASBalancedPlacement},
+			nodes: []corev1.Node{
+				*testingnode.MakeNode("b1-r1-x1").
+					Label(tasBlockLabel, "b1").
+					Label(tasRackLabel, "r1").
+					Label(corev1.LabelHostname, "x1").
+					StatusAllocatable(corev1.ResourceList{
+						"example.com/gpu":   resource.MustParse("15"),
+						corev1.ResourcePods: resource.MustParse("22"),
+					}).
+					Ready().
+					Obj(),
+				*testingnode.MakeNode("b1-r1-x2").
+					Label(tasBlockLabel, "b1").
+					Label(tasRackLabel, "r1").
+					Label(corev1.LabelHostname, "x2").
+					StatusAllocatable(corev1.ResourceList{
+						"example.com/gpu":   resource.MustParse("13"),
+						corev1.ResourcePods: resource.MustParse("22"),
+					}).
+					Ready().
+					Obj(),
+				*testingnode.MakeNode("b1-r1-x3").
+					Label(tasBlockLabel, "b1").
+					Label(tasRackLabel, "r1").
+					Label(corev1.LabelHostname, "x3").
+					StatusAllocatable(corev1.ResourceList{
+						"example.com/gpu":   resource.MustParse("10"),
+						corev1.ResourcePods: resource.MustParse("22"),
+					}).
+					Ready().
+					Obj(),
+				*testingnode.MakeNode("b1-r2-x4").
+					Label(tasBlockLabel, "b1").
+					Label(tasRackLabel, "r2").
+					Label(corev1.LabelHostname, "x4").
+					StatusAllocatable(corev1.ResourceList{
+						"example.com/gpu":   resource.MustParse("20"),
+						corev1.ResourcePods: resource.MustParse("22"),
+					}).
+					Ready().
+					Obj(),
+				*testingnode.MakeNode("b1-r2-x5").
+					Label(tasBlockLabel, "b1").
+					Label(tasRackLabel, "r2").
+					Label(corev1.LabelHostname, "x5").
+					StatusAllocatable(corev1.ResourceList{
+						"example.com/gpu":   resource.MustParse("8"),
+						corev1.ResourcePods: resource.MustParse("22"),
+					}).
+					Ready().
+					Obj(),
+			},
+			levels: defaultThreeLevels,
+			podSets: []PodSetTestCase{{
+				topologyRequest: &kueue.PodSetTopologyRequest{
+					Preferred:                   ptr.To(string(corev1.LabelHostname)),
+					PodSetSliceSize:             ptr.To(int32(2)),
+					PodSetSliceRequiredTopology: ptr.To(corev1.LabelHostname),
+				},
+				requests: resources.Requests{
+					"example.com/gpu": 1,
+				},
+				count: 22,
+				wantAssignment: &kueue.TopologyAssignment{
+					Levels: defaultOneLevel,
+					Domains: []kueue.TopologyDomainAssignment{
+						{
+							Count:  12,
+							Values: []string{"x2"},
+						},
+						{
+							Count:  10,
+							Values: []string{"x3"},
+						},
+					},
+				},
+			}},
+		},
+		//        b1
+		//         |        \
+		//        r1             r2
+		//    /    |        /     |     \
+		// x1:20  x2:8  x3:15   x4:13   x5:10
+		// request: 22
+		// expected outcome: x3:11, x4:11
+		"balanced placement; three level topology; balance on the lowest level": {
+			enableFeatureGates: []featuregate.Feature{features.TASBalancedPlacement},
+			nodes: []corev1.Node{
+				*testingnode.MakeNode("b1-r1-x1").
+					Label(tasBlockLabel, "b1").
+					Label(tasRackLabel, "r1").
+					Label(corev1.LabelHostname, "x1").
+					StatusAllocatable(corev1.ResourceList{
+						"example.com/gpu":   resource.MustParse("20"),
+						corev1.ResourcePods: resource.MustParse("22"),
+					}).
+					Ready().
+					Obj(),
+				*testingnode.MakeNode("b1-r1-x2").
+					Label(tasBlockLabel, "b1").
+					Label(tasRackLabel, "r1").
+					Label(corev1.LabelHostname, "x2").
+					StatusAllocatable(corev1.ResourceList{
+						"example.com/gpu":   resource.MustParse("8"),
+						corev1.ResourcePods: resource.MustParse("22"),
+					}).
+					Ready().
+					Obj(),
+				*testingnode.MakeNode("b1-r2-x3").
+					Label(tasBlockLabel, "b1").
+					Label(tasRackLabel, "r2").
+					Label(corev1.LabelHostname, "x3").
+					StatusAllocatable(corev1.ResourceList{
+						"example.com/gpu":   resource.MustParse("15"),
+						corev1.ResourcePods: resource.MustParse("22"),
+					}).
+					Ready().
+					Obj(),
+				*testingnode.MakeNode("b1-r2-x4").
+					Label(tasBlockLabel, "b1").
+					Label(tasRackLabel, "r2").
+					Label(corev1.LabelHostname, "x4").
+					StatusAllocatable(corev1.ResourceList{
+						"example.com/gpu":   resource.MustParse("13"),
+						corev1.ResourcePods: resource.MustParse("22"),
+					}).
+					Ready().
+					Obj(),
+				*testingnode.MakeNode("b1-r2-x5").
+					Label(tasBlockLabel, "b1").
+					Label(tasRackLabel, "r2").
+					Label(corev1.LabelHostname, "x5").
+					StatusAllocatable(corev1.ResourceList{
+						"example.com/gpu":   resource.MustParse("10"),
+						corev1.ResourcePods: resource.MustParse("22"),
+					}).
+					Ready().
+					Obj(),
+			},
+			levels: defaultThreeLevels,
+			podSets: []PodSetTestCase{{
+				topologyRequest: &kueue.PodSetTopologyRequest{
+					Preferred: ptr.To(string(corev1.LabelHostname)),
+				},
+				requests: resources.Requests{
+					"example.com/gpu": 1,
+				},
+				count: 22,
+				wantAssignment: &kueue.TopologyAssignment{
+					Levels: defaultOneLevel,
+					Domains: []kueue.TopologyDomainAssignment{
+						{
+							Count:  11,
+							Values: []string{"x3"},
+						},
+						{
+							Count:  11,
+							Values: []string{"x4"},
+						},
+					},
+				},
+			}},
+		},
+		//        b1
+		//         |
+		//        r1
+		//    /    |    \
+		// x1:20, x2:15, x3:12
+		// request: 25
+		// sliceSize: 5
+		// leaders: 1
+		// expected outcome: x2:15, x3:10 + leader
+		"balanced placement; leader worker set": {
+			enableFeatureGates: []featuregate.Feature{features.TASBalancedPlacement},
+			nodes: []corev1.Node{
+				*testingnode.MakeNode("b1-r1-x1").
+					Label(tasBlockLabel, "b1").
+					Label(tasRackLabel, "r1").
+					Label(corev1.LabelHostname, "x1").
+					StatusAllocatable(corev1.ResourceList{
+						"example.com/gpu":   resource.MustParse("20"),
+						corev1.ResourcePods: resource.MustParse("24"),
+					}).
+					Ready().
+					Obj(),
+				*testingnode.MakeNode("b1-r1-x2").
+					Label(tasBlockLabel, "b1").
+					Label(tasRackLabel, "r1").
+					Label(corev1.LabelHostname, "x2").
+					StatusAllocatable(corev1.ResourceList{
+						"example.com/gpu":   resource.MustParse("15"),
+						corev1.ResourcePods: resource.MustParse("24"),
+					}).
+					Ready().
+					Obj(),
+				*testingnode.MakeNode("b1-r1-x3").
+					Label(tasBlockLabel, "b1").
+					Label(tasRackLabel, "r1").
+					Label(corev1.LabelHostname, "x3").
+					StatusAllocatable(corev1.ResourceList{
+						"example.com/gpu":   resource.MustParse("12"),
+						corev1.ResourcePods: resource.MustParse("24"),
+					}).
+					Ready().
+					Obj(),
+			},
+			levels: defaultThreeLevels,
+			podSets: []PodSetTestCase{
+				{
+					podSetName: "leader",
+					topologyRequest: &kueue.PodSetTopologyRequest{
+						Preferred:                   ptr.To(string(tasRackLabel)),
+						PodSetSliceRequiredTopology: ptr.To(corev1.LabelHostname),
+					},
+					requests: resources.Requests{
+						"example.com/gpu": 1,
+					},
+					podSetGroupName: ptr.To("sameGroup"),
+					count:           1,
+					wantAssignment: &kueue.TopologyAssignment{
+						Levels: defaultOneLevel,
+						Domains: []kueue.TopologyDomainAssignment{
+							{
+								Count:  1,
+								Values: []string{"x3"},
+							},
+						},
+					},
+				},
+				{
+					podSetName: "workers",
+					topologyRequest: &kueue.PodSetTopologyRequest{
+						Preferred:                   ptr.To(string(tasRackLabel)),
+						PodSetSliceSize:             ptr.To(int32(5)),
+						PodSetSliceRequiredTopology: ptr.To(corev1.LabelHostname),
+					},
+					requests: resources.Requests{
+						"example.com/gpu": 1,
+					},
+					podSetGroupName: ptr.To("sameGroup"),
+					count:           25,
+					wantAssignment: &kueue.TopologyAssignment{
+						Levels: defaultOneLevel,
+						Domains: []kueue.TopologyDomainAssignment{
+							{
+								Count:  15,
+								Values: []string{"x2"},
+							},
+							{
+								Count:  10,
+								Values: []string{"x3"},
+							},
+						},
+					},
+				},
+			},
+		},
+		//                  b1
+		//              /        \
+		//            r1         r2
+		//        /   |        /  |   \
+		//     x1:10 x2:5  x3:5  x4:5  x5:5
+		// request: 15
+		// expected outcome: x3:5, x4:5, x5:5
+		"balanced placement; prioritize (using entropy) balanced domains; second rack wins": {
+			enableFeatureGates: []featuregate.Feature{features.TASBalancedPlacement},
+			nodes: []corev1.Node{
+				*testingnode.MakeNode("b1-r1-x1").
+					Label(tasBlockLabel, "b1").
+					Label(tasRackLabel, "r1").
+					Label(corev1.LabelHostname, "x1").
+					StatusAllocatable(corev1.ResourceList{
+						"example.com/gpu":   resource.MustParse("10"),
+						corev1.ResourcePods: resource.MustParse("20"),
+					}).
+					Ready().
+					Obj(),
+				*testingnode.MakeNode("b1-r1-x2").
+					Label(tasBlockLabel, "b1").
+					Label(tasRackLabel, "r1").
+					Label(corev1.LabelHostname, "x2").
+					StatusAllocatable(corev1.ResourceList{
+						"example.com/gpu":   resource.MustParse("5"),
+						corev1.ResourcePods: resource.MustParse("20"),
+					}).
+					Ready().
+					Obj(),
+				*testingnode.MakeNode("b1-r2-x3").
+					Label(tasBlockLabel, "b1").
+					Label(tasRackLabel, "r2").
+					Label(corev1.LabelHostname, "x3").
+					StatusAllocatable(corev1.ResourceList{
+						"example.com/gpu":   resource.MustParse("5"),
+						corev1.ResourcePods: resource.MustParse("20"),
+					}).
+					Ready().
+					Obj(),
+				*testingnode.MakeNode("b1-r2-x4").
+					Label(tasBlockLabel, "b1").
+					Label(tasRackLabel, "r2").
+					Label(corev1.LabelHostname, "x4").
+					StatusAllocatable(corev1.ResourceList{
+						"example.com/gpu":   resource.MustParse("5"),
+						corev1.ResourcePods: resource.MustParse("20"),
+					}).
+					Ready().
+					Obj(),
+				*testingnode.MakeNode("b1-r2-x5").
+					Label(tasBlockLabel, "b1").
+					Label(tasRackLabel, "r2").
+					Label(corev1.LabelHostname, "x5").
+					StatusAllocatable(corev1.ResourceList{
+						"example.com/gpu":   resource.MustParse("5"),
+						corev1.ResourcePods: resource.MustParse("20"),
+					}).
+					Ready().
+					Obj(),
+			},
+			levels: defaultThreeLevels,
+			podSets: []PodSetTestCase{{
+				topologyRequest: &kueue.PodSetTopologyRequest{
+					Preferred: ptr.To(string(tasRackLabel)),
+				},
+				requests: resources.Requests{
+					"example.com/gpu": 1,
+				},
+				count: 15,
+				wantAssignment: &kueue.TopologyAssignment{
+					Levels: defaultOneLevel,
+					Domains: []kueue.TopologyDomainAssignment{
+						{
+							Count:  5,
+							Values: []string{"x3"},
+						},
+						{
+							Count:  5,
+							Values: []string{"x4"},
+						},
+						{
+							Count:  5,
+							Values: []string{"x5"},
+						},
+					},
+				},
+			}},
+		},
+		//                  b1
+		//              /        \
+		//            r1          r2
+		//        /   |    \     |   \
+		//     x1:8 x2:8  x3:8  x4:16  x5:8
+		// request: 24
+		// expected outcome: x1:8, x2:8, x3:8
+		"balanced placement; prioritize (using entropy) balanced domains; first rack wins": {
+			enableFeatureGates: []featuregate.Feature{features.TASBalancedPlacement},
+			nodes: []corev1.Node{
+				*testingnode.MakeNode("b1-r1-x1").
+					Label(tasBlockLabel, "b1").
+					Label(tasRackLabel, "r1").
+					Label(corev1.LabelHostname, "x1").
+					StatusAllocatable(corev1.ResourceList{
+						"example.com/gpu":   resource.MustParse("8"),
+						corev1.ResourcePods: resource.MustParse("24"),
+					}).
+					Ready().
+					Obj(),
+				*testingnode.MakeNode("b1-r1-x2").
+					Label(tasBlockLabel, "b1").
+					Label(tasRackLabel, "r1").
+					Label(corev1.LabelHostname, "x2").
+					StatusAllocatable(corev1.ResourceList{
+						"example.com/gpu":   resource.MustParse("8"),
+						corev1.ResourcePods: resource.MustParse("24"),
+					}).
+					Ready().
+					Obj(),
+				*testingnode.MakeNode("b1-r1-x3").
+					Label(tasBlockLabel, "b1").
+					Label(tasRackLabel, "r1").
+					Label(corev1.LabelHostname, "x3").
+					StatusAllocatable(corev1.ResourceList{
+						"example.com/gpu":   resource.MustParse("8"),
+						corev1.ResourcePods: resource.MustParse("24"),
+					}).
+					Ready().
+					Obj(),
+				*testingnode.MakeNode("b1-r2-x4").
+					Label(tasBlockLabel, "b1").
+					Label(tasRackLabel, "r2").
+					Label(corev1.LabelHostname, "x4").
+					StatusAllocatable(corev1.ResourceList{
+						"example.com/gpu":   resource.MustParse("16"),
+						corev1.ResourcePods: resource.MustParse("24"),
+					}).
+					Ready().
+					Obj(),
+				*testingnode.MakeNode("b1-r2-x5").
+					Label(tasBlockLabel, "b1").
+					Label(tasRackLabel, "r2").
+					Label(corev1.LabelHostname, "x5").
+					StatusAllocatable(corev1.ResourceList{
+						"example.com/gpu":   resource.MustParse("8"),
+						corev1.ResourcePods: resource.MustParse("24"),
+					}).
+					Ready().
+					Obj(),
+			},
+			levels: defaultThreeLevels,
+			podSets: []PodSetTestCase{{
+				topologyRequest: &kueue.PodSetTopologyRequest{
+					Preferred: ptr.To(string(tasRackLabel)),
+				},
+				requests: resources.Requests{
+					"example.com/gpu": 1,
+				},
+				count: 24,
+				wantAssignment: &kueue.TopologyAssignment{
+					Levels: defaultOneLevel,
+					Domains: []kueue.TopologyDomainAssignment{
+						{
+							Count:  8,
+							Values: []string{"x1"},
+						},
+						{
+							Count:  8,
+							Values: []string{"x2"},
+						},
+						{
+							Count:  8,
+							Values: []string{"x3"},
+						},
+					},
+				},
+			}},
+		},
+		//        r1             r2
+		//    /    |        /     |     \
+		// x1:21  x2:9  x3:11   x4:10   x5:10
+		// request: 23
+		// expected outcome: x1:12, x3:11
+		"balanced placement; two level topology; balance on the highest level": {
+			enableFeatureGates: []featuregate.Feature{features.TASBalancedPlacement},
+			nodes: []corev1.Node{
+				*testingnode.MakeNode("r1-x1").
+					Label(tasRackLabel, "r1").
+					Label(corev1.LabelHostname, "x1").
+					StatusAllocatable(corev1.ResourceList{
+						"example.com/gpu":   resource.MustParse("21"),
+						corev1.ResourcePods: resource.MustParse("22"),
+					}).
+					Ready().
+					Obj(),
+				*testingnode.MakeNode("r1-x2").
+					Label(tasRackLabel, "r1").
+					Label(corev1.LabelHostname, "x2").
+					StatusAllocatable(corev1.ResourceList{
+						"example.com/gpu":   resource.MustParse("9"),
+						corev1.ResourcePods: resource.MustParse("22"),
+					}).
+					Ready().
+					Obj(),
+				*testingnode.MakeNode("r2-x3").
+					Label(tasRackLabel, "r2").
+					Label(corev1.LabelHostname, "x3").
+					StatusAllocatable(corev1.ResourceList{
+						"example.com/gpu":   resource.MustParse("11"),
+						corev1.ResourcePods: resource.MustParse("22"),
+					}).
+					Ready().
+					Obj(),
+				*testingnode.MakeNode("r2-x4").
+					Label(tasRackLabel, "r2").
+					Label(corev1.LabelHostname, "x4").
+					StatusAllocatable(corev1.ResourceList{
+						"example.com/gpu":   resource.MustParse("10"),
+						corev1.ResourcePods: resource.MustParse("22"),
+					}).
+					Ready().
+					Obj(),
+				*testingnode.MakeNode("r2-x5").
+					Label(tasRackLabel, "r2").
+					Label(corev1.LabelHostname, "x5").
+					StatusAllocatable(corev1.ResourceList{
+						"example.com/gpu":   resource.MustParse("10"),
+						corev1.ResourcePods: resource.MustParse("22"),
+					}).
+					Ready().
+					Obj(),
+			},
+			levels: []string{tasRackLabel, corev1.LabelHostname},
+			podSets: []PodSetTestCase{{
+				topologyRequest: &kueue.PodSetTopologyRequest{
+					Preferred: ptr.To(string(tasRackLabel)),
+				},
+				requests: resources.Requests{
+					"example.com/gpu": 1,
+				},
+				count: 23,
+				wantAssignment: &kueue.TopologyAssignment{
+					Levels: defaultOneLevel,
+					Domains: []kueue.TopologyDomainAssignment{
+						{
+							Count:  12,
+							Values: []string{"x1"},
+						},
+						{
+							Count:  11,
+							Values: []string{"x3"},
+						},
+					},
+				},
+			}},
+		},
+		//          b1                                b2
+		//        /      \                      /        |    \
+		//     r1         r2                r3           r4    r5
+		//    /  \       /   \        /   |    |    \     |    |
+		// x1:5  x2:5  x3:5   x4:5  x5:10 x6:4 x7:4 x8:4  x9:5 x10:5
+		// request: 20
+		// expected outcome: x1:5, x2:5, x3:5, x4:5
+		"balanced placement; select correct block taking into account pruning": {
+			enableFeatureGates: []featuregate.Feature{features.TASBalancedPlacement},
+			nodes: []corev1.Node{
+				*testingnode.MakeNode("b1-r1-x1").
+					Label(tasBlockLabel, "b1").
+					Label(tasRackLabel, "r1").
+					Label(corev1.LabelHostname, "x1").
+					StatusAllocatable(corev1.ResourceList{
+						"example.com/gpu":   resource.MustParse("5"),
+						corev1.ResourcePods: resource.MustParse("20"),
+					}).
+					Ready().
+					Obj(),
+				*testingnode.MakeNode("b1-r1-x2").
+					Label(tasBlockLabel, "b1").
+					Label(tasRackLabel, "r1").
+					Label(corev1.LabelHostname, "x2").
+					StatusAllocatable(corev1.ResourceList{
+						"example.com/gpu":   resource.MustParse("5"),
+						corev1.ResourcePods: resource.MustParse("20"),
+					}).
+					Ready().
+					Obj(),
+				*testingnode.MakeNode("b1-r2-x3").
+					Label(tasBlockLabel, "b1").
+					Label(tasRackLabel, "r2").
+					Label(corev1.LabelHostname, "x3").
+					StatusAllocatable(corev1.ResourceList{
+						"example.com/gpu":   resource.MustParse("5"),
+						corev1.ResourcePods: resource.MustParse("20"),
+					}).
+					Ready().
+					Obj(),
+				*testingnode.MakeNode("b1-r2-x4").
+					Label(tasBlockLabel, "b1").
+					Label(tasRackLabel, "r2").
+					Label(corev1.LabelHostname, "x4").
+					StatusAllocatable(corev1.ResourceList{
+						"example.com/gpu":   resource.MustParse("5"),
+						corev1.ResourcePods: resource.MustParse("20"),
+					}).
+					Ready().
+					Obj(),
+				*testingnode.MakeNode("b2-r3-x5").
+					Label(tasBlockLabel, "b2").
+					Label(tasRackLabel, "r3").
+					Label(corev1.LabelHostname, "x5").
+					StatusAllocatable(corev1.ResourceList{
+						"example.com/gpu":   resource.MustParse("10"),
+						corev1.ResourcePods: resource.MustParse("20"),
+					}).
+					Ready().
+					Obj(),
+				*testingnode.MakeNode("b2-r3-x6").
+					Label(tasBlockLabel, "b2").
+					Label(tasRackLabel, "r3").
+					Label(corev1.LabelHostname, "x6").
+					StatusAllocatable(corev1.ResourceList{
+						"example.com/gpu":   resource.MustParse("4"),
+						corev1.ResourcePods: resource.MustParse("20"),
+					}).
+					Ready().
+					Obj(),
+				*testingnode.MakeNode("b2-r3-x7").
+					Label(tasBlockLabel, "b2").
+					Label(tasRackLabel, "r3").
+					Label(corev1.LabelHostname, "x7").
+					StatusAllocatable(corev1.ResourceList{
+						"example.com/gpu":   resource.MustParse("4"),
+						corev1.ResourcePods: resource.MustParse("20"),
+					}).
+					Ready().
+					Obj(),
+				*testingnode.MakeNode("b2-r3-x8").
+					Label(tasBlockLabel, "b2").
+					Label(tasRackLabel, "r3").
+					Label(corev1.LabelHostname, "x8").
+					StatusAllocatable(corev1.ResourceList{
+						"example.com/gpu":   resource.MustParse("4"),
+						corev1.ResourcePods: resource.MustParse("20"),
+					}).
+					Ready().
+					Obj(),
+				*testingnode.MakeNode("b2-r4-x9").
+					Label(tasBlockLabel, "b2").
+					Label(tasRackLabel, "r4").
+					Label(corev1.LabelHostname, "x9").
+					StatusAllocatable(corev1.ResourceList{
+						"example.com/gpu":   resource.MustParse("5"),
+						corev1.ResourcePods: resource.MustParse("20"),
+					}).
+					Ready().
+					Obj(),
+				*testingnode.MakeNode("b2-r5-x10").
+					Label(tasBlockLabel, "b2").
+					Label(tasRackLabel, "r5").
+					Label(corev1.LabelHostname, "x10").
+					StatusAllocatable(corev1.ResourceList{
+						"example.com/gpu":   resource.MustParse("5"),
+						corev1.ResourcePods: resource.MustParse("20"),
+					}).
+					Ready().
+					Obj(),
+			},
+			levels: defaultThreeLevels,
+			podSets: []PodSetTestCase{{
+				topologyRequest: &kueue.PodSetTopologyRequest{
+					Preferred: ptr.To(tasRackLabel),
+				},
+				requests: resources.Requests{
+					"example.com/gpu": 1,
+				},
+				count: 20,
+				wantAssignment: &kueue.TopologyAssignment{
+					Levels: defaultOneLevel,
+					Domains: []kueue.TopologyDomainAssignment{
+						{
+							Count:  5,
+							Values: []string{"x1"},
+						},
+						{
+							Count:  5,
+							Values: []string{"x2"},
+						},
+						{
+							Count:  5,
+							Values: []string{"x3"},
+						},
+						{
+							Count:  5,
+							Values: []string{"x4"},
+						},
+					},
+				},
+			}},
+		},
+		//        b1
+		//         |
+		//        r1
+		//    /    |
+		// x1:6  x2:5
+		// request: 10
+		// leaders: 1
+		// expected outcome: x1:5 + leader, x2:5
+		"balanced placement; should not prune domain": {
+			enableFeatureGates: []featuregate.Feature{features.TASBalancedPlacement},
+			nodes: []corev1.Node{
+				*testingnode.MakeNode("b1-r1-x1").
+					Label(tasBlockLabel, "b1").
+					Label(tasRackLabel, "r1").
+					Label(corev1.LabelHostname, "x1").
+					StatusAllocatable(corev1.ResourceList{
+						"example.com/gpu":   resource.MustParse("6"),
+						corev1.ResourcePods: resource.MustParse("24"),
+					}).
+					Ready().
+					Obj(),
+				*testingnode.MakeNode("b1-r1-x2").
+					Label(tasBlockLabel, "b1").
+					Label(tasRackLabel, "r1").
+					Label(corev1.LabelHostname, "x2").
+					StatusAllocatable(corev1.ResourceList{
+						"example.com/gpu":   resource.MustParse("5"),
+						corev1.ResourcePods: resource.MustParse("24"),
+					}).
+					Ready().
+					Obj(),
+			},
+			levels: defaultThreeLevels,
+			podSets: []PodSetTestCase{
+				{
+					podSetName: "leader",
+					topologyRequest: &kueue.PodSetTopologyRequest{
+						Preferred:                   ptr.To(string(tasRackLabel)),
+						PodSetSliceRequiredTopology: ptr.To(corev1.LabelHostname),
+					},
+					requests: resources.Requests{
+						"example.com/gpu": 1,
+					},
+					podSetGroupName: ptr.To("sameGroup"),
+					count:           1,
+					wantAssignment: &kueue.TopologyAssignment{
+						Levels: defaultOneLevel,
+						Domains: []kueue.TopologyDomainAssignment{
+							{
+								Count:  1,
+								Values: []string{"x1"},
+							},
+						},
+					},
+				},
+				{
+					podSetName: "workers",
+					topologyRequest: &kueue.PodSetTopologyRequest{
+						Preferred: ptr.To(string(tasRackLabel)),
+					},
+					requests: resources.Requests{
+						"example.com/gpu": 1,
+					},
+					podSetGroupName: ptr.To("sameGroup"),
+					count:           10,
+					wantAssignment: &kueue.TopologyAssignment{
+						Levels: defaultOneLevel,
+						Domains: []kueue.TopologyDomainAssignment{
+							{
+								Count:  5,
+								Values: []string{"x1"},
+							},
+							{
+								Count:  5,
+								Values: []string{"x2"},
+							},
+						},
+					},
+				},
+			},
+		},
 		"block required for podset; rack required for slices; podset fits in a block, but slices do not fit in racks": {
 
 			//         b1
diff --git a/test/integration/singlecluster/scheduler/fairsharing/fair_sharing_test.go b/test/integration/singlecluster/scheduler/fairsharing/fair_sharing_test.go
index 01d0d9676..5dd9e20c1 100644
--- a/test/integration/singlecluster/scheduler/fairsharing/fair_sharing_test.go
+++ b/test/integration/singlecluster/scheduler/fairsharing/fair_sharing_test.go
@@ -60,10 +60,12 @@ var _ = ginkgo.Describe("Scheduler", ginkgo.Ordered, ginkgo.ContinueOnFailure, f
 
 	var createQueue = func(cq *kueue.ClusterQueue) *kueue.ClusterQueue {
 		util.MustCreate(ctx, k8sClient, cq)
+		util.ExpectClusterQueuesToBeActive(ctx, k8sClient, cq)
 		cqs = append(cqs, cq)
 
 		lq := utiltestingapi.MakeLocalQueue(cq.Name, ns.Name).ClusterQueue(cq.Name).Obj()
 		util.MustCreate(ctx, k8sClient, lq)
+		util.ExpectLocalQueuesToBeActive(ctx, k8sClient, lq)
 		lqs = append(lqs, lq)
 		return cq
 	}
@@ -953,34 +955,35 @@ var _ = ginkgo.Describe("Scheduler", ginkgo.Ordered, ginkgo.ContinueOnFailure, f
 
 		ginkgo.It("sticky workload deleted, next workload can admit", func() {
 			ginkgo.By("Creating borrowing workloads in queue2")
-			createWorkload("cq2", "1")
-			createWorkload("cq2", "1")
+			createWorkloadWithPriority("cq2", "1", 0)
+			createWorkloadWithPriority("cq2", "1", 0)
 			util.ExpectAdmittedWorkloadsTotalMetric(cq2, "", 2)
 
-			ginkgo.By("Create inadmissible workload in queue1")
-			createWorkloadWithPriority("cq1", "4", 999)
-
-			ginkgo.By("Verify doesn't admit")
-			util.ExpectAdmittedWorkloadsTotalMetric(cq1, "", 0)
-
 			ginkgo.By("Create admissible workloads in queue1")
 			stickyWorkload := createWorkloadWithPriority("cq1", "3", 99)
 
+			ginkgo.By("Verify the workload is counted as pending active")
+			util.ExpectPendingWorkloadsMetric(cq1, 1, 0)
+
 			ginkgo.By("Another admissible workload in queue1")
 			createWorkloadWithPriority("cq1", "3", 0)
 
+			ginkgo.By("Validate pending workloads")
+			util.ExpectPendingWorkloadsMetric(cq1, 2, 0)
+
 			ginkgo.By("Delete sticky workload")
 			util.ExpectObjectToBeDeleted(ctx, k8sClient, stickyWorkload, true)
 
 			ginkgo.By("Validate pending workloads")
-			util.ExpectPendingWorkloadsMetric(cq1, 1, 1)
+			util.ExpectPendingWorkloadsMetric(cq1, 1, 0)
 
 			ginkgo.By("Complete preemption")
 			util.FinishEvictionOfWorkloadsInCQ(ctx, k8sClient, cq2, 2)
 
 			ginkgo.By("Expected Total Admitted Workloads and Weighted Share")
 			util.ExpectAdmittedWorkloadsTotalMetric(cq1, "", 1)
-			util.ExpectClusterQueueWeightedShareMetric(cq1, 0.0)
+			util.ExpectAdmittedWorkloadsTotalMetric(cq2, "", 2)
+			util.ExpectClusterQueueWeightedShareMetric(cq1, 1000)
 			util.ExpectClusterQueueWeightedShareMetric(cq2, 0.0)
 		})
 	})
diff --git a/test/integration/singlecluster/tas/tas_test.go b/test/integration/singlecluster/tas/tas_test.go
index a6e90e4e2..fd606fc8a 100644
--- a/test/integration/singlecluster/tas/tas_test.go
+++ b/test/integration/singlecluster/tas/tas_test.go
@@ -1447,7 +1447,176 @@ var _ = ginkgo.Describe("Topology Aware Scheduling", ginkgo.Ordered, func() {
 				})
 			})
 		})
+		ginkgo.When("TASBalancePlacement is enabled", func() {
+			var (
+				nodes []corev1.Node
+			)
+			ginkgo.BeforeEach(func() {
+				nodes = []corev1.Node{
+					*testingnode.MakeNode("x1").
+						Label("node-group", "tas").
+						Label(utiltesting.DefaultBlockTopologyLevel, "b1").
+						Label(utiltesting.DefaultRackTopologyLevel, "r1").
+						Label(corev1.LabelHostname, "x1").
+						StatusAllocatable(corev1.ResourceList{
+							"nvidia.com/gpu":      resource.MustParse("12"),
+							corev1.ResourceCPU:    resource.MustParse("1"),
+							corev1.ResourceMemory: resource.MustParse("1Gi"),
+							corev1.ResourcePods:   resource.MustParse("20"),
+						}).
+						Ready().
+						Obj(),
+					*testingnode.MakeNode("x2").
+						Label("node-group", "tas").
+						Label(utiltesting.DefaultBlockTopologyLevel, "b1").
+						Label(utiltesting.DefaultRackTopologyLevel, "r1").
+						Label(corev1.LabelHostname, "x2").
+						StatusAllocatable(corev1.ResourceList{
+							"nvidia.com/gpu":      resource.MustParse("12"),
+							corev1.ResourceCPU:    resource.MustParse("1"),
+							corev1.ResourceMemory: resource.MustParse("1Gi"),
+							corev1.ResourcePods:   resource.MustParse("20"),
+						}).
+						Ready().
+						Obj(),
+					*testingnode.MakeNode("x3").
+						Label("node-group", "tas").
+						Label(utiltesting.DefaultBlockTopologyLevel, "b1").
+						Label(utiltesting.DefaultRackTopologyLevel, "r2").
+						Label(corev1.LabelHostname, "x3").
+						StatusAllocatable(corev1.ResourceList{
+							"nvidia.com/gpu":      resource.MustParse("14"),
+							corev1.ResourceCPU:    resource.MustParse("1"),
+							corev1.ResourceMemory: resource.MustParse("1Gi"),
+							corev1.ResourcePods:   resource.MustParse("20"),
+						}).
+						Ready().
+						Obj(),
+					*testingnode.MakeNode("x4").
+						Label("node-group", "tas").
+						Label(utiltesting.DefaultBlockTopologyLevel, "b1").
+						Label(utiltesting.DefaultRackTopologyLevel, "r2").
+						Label(corev1.LabelHostname, "x4").
+						StatusAllocatable(corev1.ResourceList{
+							"nvidia.com/gpu":      resource.MustParse("6"),
+							corev1.ResourceCPU:    resource.MustParse("1"),
+							corev1.ResourceMemory: resource.MustParse("1Gi"),
+							corev1.ResourcePods:   resource.MustParse("20"),
+						}).
+						Ready().
+						Obj(),
+				}
+				util.CreateNodesWithStatus(ctx, k8sClient, nodes)
+
+				topology = utiltestingapi.MakeDefaultThreeLevelTopology("default")
+				util.MustCreate(ctx, k8sClient, topology)
+
+				tasFlavor = utiltestingapi.MakeResourceFlavor("tas-flavor").
+					NodeLabel("node-group", "tas").
+					TopologyName("default").Obj()
+				util.MustCreate(ctx, k8sClient, tasFlavor)
+
+				clusterQueue = utiltestingapi.MakeClusterQueue("cluster-queue").
+					ResourceGroup(*utiltestingapi.MakeFlavorQuotas(tasFlavor.Name).Resource("nvidia.com/gpu", "40").Obj()).
+					Obj()
+				util.MustCreate(ctx, k8sClient, clusterQueue)
+				util.ExpectClusterQueuesToBeActive(ctx, k8sClient, clusterQueue)
+
+				localQueue = utiltestingapi.MakeLocalQueue("local-queue", ns.Name).ClusterQueue(clusterQueue.Name).Obj()
+				util.MustCreate(ctx, k8sClient, localQueue)
 
+				_ = features.SetEnable(features.TASBalancedPlacement, true)
+			})
+
+			ginkgo.AfterEach(func() {
+				gomega.Expect(util.DeleteAllJobsInNamespace(ctx, k8sClient, ns)).Should(gomega.Succeed())
+				gomega.Expect(util.DeleteWorkloadsInNamespace(ctx, k8sClient, ns)).Should(gomega.Succeed())
+				gomega.Expect(util.DeleteObject(ctx, k8sClient, localQueue)).Should(gomega.Succeed())
+				util.ExpectObjectToBeDeleted(ctx, k8sClient, clusterQueue, true)
+				util.ExpectObjectToBeDeleted(ctx, k8sClient, tasFlavor, true)
+				util.ExpectObjectToBeDeleted(ctx, k8sClient, topology, true)
+				for _, node := range nodes {
+					util.ExpectObjectToBeDeleted(ctx, k8sClient, &node, true)
+				}
+
+				_ = features.SetEnable(features.TASBalancedPlacement, false)
+			})
+
+			ginkgo.It("place the workers evenly on selected nodes", func() {
+				var wl1 *kueue.Workload
+
+				ginkgo.By("creating a workload", func() {
+					wl1 = utiltestingapi.MakeWorkload("wl1", ns.Name).
+						PodSets(*utiltestingapi.MakePodSet("worker", 16).
+							PreferredTopologyRequest(utiltesting.DefaultRackTopologyLevel).
+							SliceRequiredTopologyRequest(corev1.LabelHostname).
+							SliceSizeTopologyRequest(4).
+							Obj()).
+						Queue(kueue.LocalQueueName(localQueue.Name)).Request("nvidia.com/gpu", "1").Obj()
+					util.MustCreate(ctx, k8sClient, wl1)
+				})
+
+				ginkgo.By("verify the workload is admitted", func() {
+					util.ExpectWorkloadsToBeAdmitted(ctx, k8sClient, wl1)
+					gomega.Expect(k8sClient.Get(ctx, client.ObjectKeyFromObject(wl1), wl1)).To(gomega.Succeed())
+					gomega.Expect(wl1.Status.Admission.PodSetAssignments[0].TopologyAssignment).Should(gomega.BeComparableTo(
+						&kueue.TopologyAssignment{
+							Levels: []string{corev1.LabelHostname},
+							Domains: []kueue.TopologyDomainAssignment{
+								{Count: 8, Values: []string{"x1"}},
+								{Count: 8, Values: []string{"x2"}},
+							},
+						},
+					))
+				})
+			})
+			ginkgo.It("place the leader and workers evenly on selected nodes", func() {
+				var wl1 *kueue.Workload
+
+				ginkgo.By("creating a workload", func() {
+					wl1 = utiltestingapi.MakeWorkload("wl1", ns.Name).
+						PodSets(
+							*utiltestingapi.MakePodSet("leader", 1).
+								PodSetGroup("group").
+								PreferredTopologyRequest(utiltesting.DefaultRackTopologyLevel).
+								SliceRequiredTopologyRequest(corev1.LabelHostname).
+								Request("nvidia.com/gpu", "1").
+								Obj(),
+							*utiltestingapi.MakePodSet("worker", 30).
+								PodSetGroup("group").
+								PreferredTopologyRequest(utiltesting.DefaultRackTopologyLevel).
+								SliceRequiredTopologyRequest(corev1.LabelHostname).
+								SliceSizeTopologyRequest(5).
+								Request("nvidia.com/gpu", "1").
+								Obj()).
+						Queue(kueue.LocalQueueName(localQueue.Name)).Obj()
+					util.MustCreate(ctx, k8sClient, wl1)
+				})
+
+				ginkgo.By("verify the workload is admitted", func() {
+					util.ExpectWorkloadsToBeAdmitted(ctx, k8sClient, wl1)
+					gomega.Expect(k8sClient.Get(ctx, client.ObjectKeyFromObject(wl1), wl1)).To(gomega.Succeed())
+					gomega.Expect(wl1.Status.Admission.PodSetAssignments[0].TopologyAssignment).Should(gomega.BeComparableTo(
+						&kueue.TopologyAssignment{
+							Levels: []string{corev1.LabelHostname},
+							Domains: []kueue.TopologyDomainAssignment{
+								{Count: 1, Values: []string{"x1"}},
+							},
+						},
+					))
+					gomega.Expect(wl1.Status.Admission.PodSetAssignments[1].TopologyAssignment).Should(gomega.BeComparableTo(
+						&kueue.TopologyAssignment{
+							Levels: []string{corev1.LabelHostname},
+							Domains: []kueue.TopologyDomainAssignment{
+								{Count: 10, Values: []string{"x1"}},
+								{Count: 10, Values: []string{"x2"}},
+								{Count: 10, Values: []string{"x3"}},
+							},
+						},
+					))
+				})
+			})
+		})
 		ginkgo.When("Preemption is enabled within ClusterQueue", func() {
 			var (
 				nodes []corev1.Node