-
Notifications
You must be signed in to change notification settings - Fork 536
Windows x64 Build with support for xnnpack and llama example #6979
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
Closed
Closed
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
33c9f75
fix resolve_buck on windows
chinazhangchao 555246a
- add runtime/platform/unistd.h for Windows x64 compatibility
77d1428
fix install_requirements.bat
chinazhangchao c8beaf3
Merge branch 'pytorch:main' into win_build
vortex-captain eaeb483
Merge branch 'pytorch:main' into win_build
vortex-captain 6c9bc9e
- fix lintrunner/linux-job issues
0a56ebc
merge mman and fix some build issue
chinazhangchao 14324cd
add pread function to unistd.h
chinazhangchao d58c11a
Merge branch 'win_build' into xnnpack
chinazhangchao d232bff
fix build issue
chinazhangchao d59096a
fix build issue
chinazhangchao 5d10dfa
Merge branch 'pytorch:main' into win_build
chinazhangchao ecb0042
fix flatcc build issue
chinazhangchao 19033e2
fix windows build issue
chinazhangchao d46f329
make examples/models/llama/runner build in win_x64
8e2b8bd
followup fixes for llama example in Windows; add missing /WHOLEARCHIV…
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
rem Install snakeviz for cProfile flamegraph | ||
rem Install sentencepiece for llama tokenizer | ||
pip install snakeviz sentencepiece | ||
|
||
rem Install torchao. | ||
pip install "%~dp0/../../../third-party/ao" | ||
|
||
rem Install lm-eval for Model Evaluation with lm-evalution-harness | ||
rem Install tiktoken for tokenizer | ||
pip install lm_eval==0.4.5 | ||
pip install tiktoken blobfile | ||
rem Restore numpy if >= 2.0 | ||
pip install "numpy<2.0" | ||
|
||
rem Call the install helper for further setup | ||
python examples/models/llama/install_requirement_helper.py |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/* | ||
* Copyright (c) Meta Platforms, Inc. and affiliates. | ||
* All rights reserved. | ||
* | ||
* This source code is licensed under the BSD-style license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
// This file ensures that mman.h compatible functions are defined in the global | ||
// namespace for windows and posix environments. | ||
|
||
#pragma once | ||
|
||
#include <executorch/runtime/platform/compiler.h> | ||
|
||
#ifndef _WIN32 | ||
|
||
#include <sys/mman.h> | ||
#include <unistd.h> | ||
|
||
ET_INLINE long get_os_page_size(){return sysconf(_SC_PAGESIZE);} | ||
|
||
#else | ||
|
||
#define NOMINMAX | ||
#include <windows.h> | ||
#undef NOMINMAX | ||
#include <io.h> | ||
|
||
#include <executorch/extension/data_loader/mman_windows.h> | ||
|
||
ET_INLINE long get_os_page_size() { | ||
SYSTEM_INFO si; | ||
GetSystemInfo(&si); | ||
long pagesize = si.dwAllocationGranularity > si.dwPageSize | ||
? si.dwAllocationGranularity | ||
: si.dwPageSize; | ||
return pagesize; | ||
} | ||
|
||
#endif |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this looks fine to me, i'm assuming this has to be done for every flatbuffer outputted header file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the review! As suggested, we will split into smaller PRs (#7217), and apply these "platform-dependent shell command" changes everywhere in a later PR