Skip to content

[wasm] EmccCompile: Add support for compiling sequentially - #67483

Closed
radical wants to merge 6 commits into
dotnet:mainfrom
radical:wasm-retry
Closed

[wasm] EmccCompile: Add support for compiling sequentially#67483
radical wants to merge 6 commits into
dotnet:mainfrom
radical:wasm-retry

Conversation

@radical

@radicalradical commented Apr 2, 2022

Copy link
Copy Markdown
Member

Add support for user specified assemblies that should always be compiled
sequentially. This would be useful for cases where some assemblies fail to compile
because emcc runs out of memory when compiled in parallel with other assemblies.

New:

 - @(WasmAssemblyToAOTSequentially) - Filenames of assemblies to always compile (to .o) sequentially

This adds support for two cases:
1. Compiling an assembly in parallel fails due to getting oomkill'ed.
In this case, it will get compiled again but not in parallel with
anything else.
2. User specified assemblies that should always be compiled
sequentially.
This would be useful for cases where some assemblies fail to compile
because `emcc` runs out of memory.
New:
```
- $(WasmRetrySequentiallyIfNeeded) - Retry assembly compilation to .o files sequentially, if needed.
One such case could be if the compiler got killed due to OOM.
Defaults to true.
- @(WasmAssemblyToAOTSequentially) - Filenames of assemblies to always compile (to .o) sequentially
```
@radicalradical added arch-wasm WebAssembly architecture area-Build-mono labels Apr 2, 2022
@ghostghost assigned radicalApr 2, 2022
@ghost

ghost commented Apr 2, 2022

Copy link
Copy Markdown

Tagging subscribers to 'arch-wasm': @lewing
See info in area-owners.md if you want to be subscribed.

Issue Details

This adds support for two cases:

  1. Compiling an assembly in parallel fails due to getting oomkill'ed.
    In this case, it will get compiled again but not in parallel with
    anything else.

  2. User specified assemblies that should always be compiled
    sequentially.

This would be useful for cases where some assemblies fail to compile
because emcc runs out of memory.

New:

 - $(WasmRetrySequentiallyIfNeeded) - Retry assembly compilation to .o files sequentially, if needed.
One such case could be if the compiler got killed due to OOM.
Defaults to true.
- @(WasmAssemblyToAOTSequentially) - Filenames of assemblies to always compile (to .o) sequentially
Author:radical
Assignees:-
Labels:

arch-wasm, area-Build-mono

Milestone:-

@radical

Copy link
Copy Markdown
MemberAuthor

/azp run runtime-wasm

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@vargaz

Copy link
Copy Markdown
Contributor

Not sure that a build system should retry failing commands. Would a setting limiting the amount of parallelism, like make's -j argument work ?

@radical

Copy link
Copy Markdown
MemberAuthor

Not sure that a build system should retry failing commands. Would a setting limiting the amount of parallelism, like make's -j argument work ?

Using only -j like argument would limit that for all the files, instead of a few, which is the problem that I was trying to solve here. Like when some assemblies run out of memory when aot'ed at the same time as others, but compile fine when aot'ed by themselves.

I have removed the retry mechanism here.

@radical

Copy link
Copy Markdown
MemberAuthor

/azp run runtime-wasm

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@radical
radical requested a review from vargazApril 4, 2022 22:02
@radical

Copy link
Copy Markdown
MemberAuthor

/azp run runtime-wasm

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@lewing

Copy link
Copy Markdown
Member

@ankit do you still think this is useful?

@marek-safarmarek-safar added the needs-author-action An issue or pull request that requires more info or actions from the author. label Jul 19, 2022
@ghostghost added the no-recent-activity label Aug 2, 2022
@ghost

ghost commented Aug 2, 2022

Copy link
Copy Markdown

This pull request has been automatically marked no-recent-activity because it has not had any activity for 14 days. It will be closed if no further activity occurs within 14 more days. Any new comment (by anyone, not necessarily the author) will remove no-recent-activity.

@ghostghost removed the needs-author-action An issue or pull request that requires more info or actions from the author. label Aug 8, 2022
@lewing
lewing marked this pull request as draft November 29, 2022 19:11
@ghostghost closed this Dec 29, 2022
@ghost

Copy link
Copy Markdown

Draft Pull Request was automatically closed for 30 days of inactivity. Please let us know if you'd like to reopen it.

@ghostghost locked as resolved and limited conversation to collaborators Jan 29, 2023
This pull request was closed.
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

arch-wasmWebAssembly architecturearea-Build-mono

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@radical@vargaz@lewing@marek-safar