Giter Site home page Giter Site logo

Comments (5)

hlky avatar hlky commented on June 14, 2024 1

The same fix was applied to my (currently unmaintained) fork here and here so I can confirm it fixes this particular issue, however there are other Windows issues and just to note constants have a ~2GB limit on Windows.

from aitemplate.

chenyang78 avatar chenyang78 commented on June 14, 2024

Hmm, seems this line wasn't hit in your case:

The existing Windows support was contributed and maintained by one of our ex-colleagues. We don't support Windows officially. Any Windows-related patches are very welcome! Thanks.

from aitemplate.

hlky avatar hlky commented on June 14, 2024
--- a/python/aitemplate/backend/codegen.py
+++ b/python/aitemplate/backend/codegen.py
@@ -49,7 +49,7 @@ from aitemplate.utils.environ import (
     multistream_mode,
 )
 from aitemplate.utils.graph_utils import split_simple_multistream_parallel_ops
-from aitemplate.utils.misc import is_debug
+from aitemplate.utils.misc import is_debug, is_windows
 
 # pylint: disable=C0103,W0613,C0301
 
@@ -1095,8 +1095,7 @@ class ModelContainerGenerator:
             set_up_constant_folding_inputs="\n".join(
                 self.set_up_constant_folding_inputs
             ),
-            # # todo: enable once this feature is fully available
-            # is_windows=is_windows(),
+            is_windows=is_windows(),
         )
         result[model_container_src_fname] = model_container_base_src
         return result
--- a/python/aitemplate/backend/main_templates.py
+++ b/python/aitemplate/backend/main_templates.py
@@ -322,13 +322,13 @@ MODEL_CONTAINER_TEMPLATE = jinja2.Template(
 #include "model_container.h"
 #include "owned_constants.h"
 
-namespace ait {
-namespace {
-
 {% if is_windows %}
 #include "windll.h"
 {% endif %}
 
+namespace ait {
+namespace {
+
 // Contains the metadata for each constant.
 constexpr std::array<ConstantInfo, {{ num_constants }}> owned_constants = {
   {{ owned_constants_init }}

from aitemplate.

chenyang78 avatar chenyang78 commented on June 14, 2024

Thanks for the investigation and sharing the patch, @hlky ! Given the comment left by the original author of windows support, "todo: enable once this feature is fully available", I am quite hesitant to apply it to the main branch, because we don't have any test coverage nor any one is actively working on Windows support.

@joye I think you might want to try the patch shared by @hlky and see if it would work for you. Thanks!

from aitemplate.

joye avatar joye commented on June 14, 2024

Thanks @hlky, this patch can work in my side.

from aitemplate.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.