Comments (12)
Thank you for trying it out! @dbort any idea for this error?
from executorch.
@cccclai, I just checked the environment variable in my python script and it shows empty. When I add this " os.putenv("HOME", "/usr/home")" to my run function my problem is solved.
class Buck2Runner:
def init(self, tool_path: str) -> None:
self._path = tool_path
def run(self, args: Sequence[str]) -> list[str]:
"""Runs buck2 with the given args and returns its stdout as a sequence of lines."""
os.putenv("HOME", "/usr/home")
try:
cp: subprocess.CompletedProcess = subprocess.run(
[self._path] + args, capture_output=True, cwd=BUCK_CWD, check=True
)
return [line.strip().decode("utf-8") for line in cp.stdout.splitlines()]
except subprocess.CalledProcessError as ex:
raise RuntimeError(ex.stderr.decode("utf-8")) from ex
Do you have any suggestions on this?
from executorch.
Thanks for reporting this issue. Must've been caused by this logic that I added to make things work in the CI jobs:
Lines 494 to 498 in 3a2b2e8
The question is why it's happening for you but not for other users, and not for the CI jobs. The buck2 check itself is at https://github.com/facebook/buck2/blob/ad891c4934458a461b5fcf375e2c17302df00c0d/app/buck2_common/src/invocation_roots.rs#L125, which was added in the buck2 2023-08-15 release, which should be part of the 2024-02-15 release that executorch uses (https://github.com/pytorch/executorch/blob/main/.ci/docker/ci_commit_pins/buck2.txt).
To unblock yourself quickly, you could make a local change that removes this logic:
--- a/setup.py
+++ b/setup.py
@@ -490,17 +490,8 @@ class CustomBuild(build):
if not self.dry_run:
# Dry run should log the command but not actually run it.
(Path(cmake_cache_dir) / "CMakeCache.txt").unlink(missing_ok=True)
- try:
- # This script is sometimes run as root in docker containers. buck2
- # doesn't allow running as root unless $HOME is owned by root or
- # does not exist. So temporarily undefine it while configuring
- # cmake, which runs buck2 to get some source lists.
- old_home = os.environ.pop("HOME", None)
- # Generate the build system files.
- self.spawn(["cmake", "-S", repo_root, "-B", cmake_cache_dir, *cmake_args])
- finally:
- if old_home is not None:
- os.environ["HOME"] = old_home
+ # Generate the build system files.
+ self.spawn(["cmake", "-S", repo_root, "-B", cmake_cache_dir, *cmake_args])
# Build the system.
self.spawn(["cmake", "--build", cmake_cache_dir, *build_args])
The real fix is to stop running the jobs as root (pytorch/test-infra#5091). But I could at least reduce the blast radius of this hack by only removing the HOME
definition when running as root. And ultimately we want to remove buck2 from this flow altogether.
from executorch.
@gochaudhari if you have a chance, could you try patching in #3507 to see if it fixes the problem for you?
from executorch.
@dbort I tried it just now. It is working for me. However, I am not running it as a root user.
from executorch.
@gochaudhari Great, thanks for checking! Don't worry about running as root, I'm testing that elsewhere. My main goal was to make sure that this fixes your problem.
from executorch.
I've merged the fix into main
, and it should also be available in the upcoming v0.2.1
patch release. Thank you @gochaudhari for reporting this bug and for helping me validate the fix!
from executorch.
Thank @dbort and @cccclai for the fix.
from executorch.
I have the same issue when I submodule executorch and run cmake from the subpath. It works fine if I directly clone executorch and run cmake from there.
from executorch.
I have the same issue when I submodule executorch and run cmake from the subpath. It works fine if I directly clone executorch and run cmake from there.
@leigao97 Does this happen to you in the main
branch? Which executorch git hash are you synced to when this happens?
from executorch.
I am using the main branch. I think I found the reason. The path or the parent folder should not have the character "-" or maybe other ones like "." as I saw the same problem from #3524. Once I rename the parent folder, buck2 works.
from executorch.
Wow weird, thanks for tracking that down @leigao97 ! Good to know: this sounds like some unusual buck2 behavior.
from executorch.
Related Issues (20)
- memory issue during export_llama? HOT 5
- Add bf16 kernel support
- WebAssembly / Web runtime (both for wasm-simd and WebGPU) HOT 3
- Downstream users have dependences on cmake variables and internals, making cmake a compatibility surface
- Executorch reports a bug for pages and pages: [method.cpp:939] Overriding output data pointer allocated by memory plan is not allowed. HOT 1
- `torch.max(input)` fails at XNNPACK runtime
- Why is `torch.min` not ATen canonical? HOT 2
- kv cache manipulation? HOT 8
- converting llama3 models with added tokens HOT 3
- "Error creating cell resolver" buck2 failure while building wheel HOT 2
- ERROR: Overriding output data pointer allocated by memory plan is not allowed. HOT 5
- to edge IR from transformers library model HOT 2
- Can I run ExecuTorch on ARM Cortex-A53 processor? HOT 3
- Executorch exported model produces gibberish: stories15M --dtype fp32 --quantize '{"embedding": {"bitwidth": 4, "groupsize":32}, "linear:a8w4dq": {"groupsize" : 256}}' HOT 1
- Support Phi 3 model HOT 1
- Exporting Llama3's tokenizer HOT 6
- Quantize Llava encoder
- what's the meaning of "Groupwise 4-bit (128)" HOT 4
- ExecuTorch Build Problem HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from executorch.