Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump actions/download-artifact from 3 to 4.1.7 in /.github/workflows #1

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -379,7 +379,7 @@ jobs:
python3 -m pip install -e .
echo "BRANCH_NAME=${GITHUB_REF##*/}" >> $GITHUB_ENV
- name: Download Metrics
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4.1.7
with:
name: metrics
path: current
@@ -429,12 +429,12 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GH_TOKEN }}
- name: Download Image (Docker/amd64)
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4.1.7
with:
name: docker-image-amd64
path: /tmp/docker
- name: Download Image (Docker/aarch64)
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4.1.7
with:
name: docker-image-aarch64
path: /tmp/docker
7 changes: 7 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -13,6 +13,13 @@
## API Breaks
## Documentation
-->
# 2.0.11

## Misc Enhancements/Bugfixes

* Fixed a deadlock in some situations because of `OpenROAD.STAPrePNR` using the
global thread-pool for OpenLane, which may be used to run the step itself.

# 2.0.10

## Tool Updates
2 changes: 1 addition & 1 deletion openlane/__version__.py
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@
# 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.
__version__ = "2.0.10"
__version__ = "2.0.11-1"

if __name__ == "__main__":
print(__version__, end="")
6 changes: 5 additions & 1 deletion openlane/common/tpe.py
Original file line number Diff line number Diff line change
@@ -23,6 +23,9 @@ def set_tpe(tpe: ThreadPoolExecutor):
Allows replacing OpenLane's global ``ThreadPoolExecutor`` with a customized
one.

It will be used inside steps, so use different TPEs inside steps to avoid
a deadlock.

:param tpe: The replacement ThreadPoolExecutor
"""
global TPE
@@ -31,7 +34,8 @@ def set_tpe(tpe: ThreadPoolExecutor):

def get_tpe() -> ThreadPoolExecutor:
"""
:returns: OpenLane's global ``ThreadPoolExecutor``
:returns: OpenLane's global ``ThreadPoolExecutor``. This is used to run
steps, so do not use them inside steps to avoid a deadlock.
"""
global TPE
return TPE
25 changes: 21 additions & 4 deletions openlane/steps/openroad.py
Original file line number Diff line number Diff line change
@@ -25,7 +25,7 @@
from base64 import b64encode
from abc import abstractmethod
from dataclasses import dataclass
from concurrent.futures import Future
from concurrent.futures import Future, ThreadPoolExecutor
from typing import (
Any,
List,
@@ -72,7 +72,6 @@
Path,
TclUtils,
get_script_dir,
get_tpe,
mkdirp,
aggregate_metrics,
process_list_file,
@@ -545,6 +544,11 @@ class MultiCornerSTA(OpenSTAStep):
Optional[List[Union[str, Path]]],
"A variable that only exists for backwards compatibility with OpenLane <2.0.0 and should not be used by new designs.",
),
Variable(
"STA_THREADS",
Optional[int],
"The maximum number of STA corners to run in parallel. If unset, this will be equal to your machine's thread count.",
),
]

def get_script_path(self):
@@ -583,6 +587,10 @@ def run(self, state_in: State, **kwargs) -> Tuple[ViewsUpdate, MetricsUpdate]:
kwargs, env = self.extract_env(kwargs)
env = self.prepare_env(env, state_in)

tpe = ThreadPoolExecutor(
max_workers=self.config["STA_THREADS"] or os.cpu_count() or 1
)

futures: Dict[str, Future[MetricsUpdate]] = {}
files_so_far: Dict[OpenSTAStep.CornerFileList, str] = {}
corners_used: Set[str] = set()
@@ -604,7 +612,7 @@ def run(self, state_in: State, **kwargs) -> Tuple[ViewsUpdate, MetricsUpdate]:
corner_dir = os.path.join(self.step_dir, corner)
mkdirp(corner_dir)

futures[corner] = get_tpe().submit(
futures[corner] = tpe.submit(
self.run_corner,
state_in,
current_env,
@@ -1644,6 +1652,11 @@ class RCX(OpenROADStep):
"Map of corner patterns to OpenRCX extraction rules.",
pdk=True,
),
Variable(
"STA_THREADS",
Optional[int],
"The maximum number of STA corners to run in parallel. If unset, this will be equal to your machine's thread count.",
),
]

inputs = [DesignFormat.DEF]
@@ -1711,9 +1724,13 @@ def run_corner(corner: str):

return out

tpe = ThreadPoolExecutor(
max_workers=self.config["STA_THREADS"] or os.cpu_count() or 1
)

futures: Dict[str, Future[str]] = {}
for corner in self.config["RCX_RULESETS"]:
futures[corner] = get_tpe().submit(
futures[corner] = tpe.submit(
run_corner,
corner,
)
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -10,4 +10,4 @@ libparse>=0.3.1,<1
psutil>=5.9.0
httpx>=0.22.0, <0.28
ioplace_parser~=0.2.0
klayout>=0.28.17.post1,<0.29.0
klayout>=0.28.17.post1,<=0.29.5