Skip to content

BrainScript extension for Visual Studio Code #1962

Closed
@vermorel

Description

@vermorel
Contributor

Visual Studio Code is getting a huge momentum. It would be extremely nice if BrainScript had its own VS Code extension. BrainScript is amazing, however, it's still lacking support in the IDE that are actually used by the broader Microsoft dev community. An VS Code extension would significantly boost adoption of BrainScript, the software effort being modest.

Activity

cha-zhang

cha-zhang commented on Jun 4, 2017

@cha-zhang
Member

We need to understand better how many people are still on BrainScript, and why. In general CNTK is moving towards Python, and we are not adding more support to BrainScript. Our primary assumption is BrainScript is yet another script language and people don't want to learn it. This, of course, can be changed if there is huge demand to keep BrainScript up-to-date.

Could those who are using BrainScript explain why you are not switching to Python? Simplicity? Performance? Legacy code? Or something else?

ghost
cha-zhang

cha-zhang commented on Jun 4, 2017

@cha-zhang
Member

AFAIK, CNTK's Python binding today has less than 1% performance hit in the worst case, and in many cases much faster due to better sparse data handling. It's very simple to use as well.

Can you expand on the clean execution argument?

ghost
cha-zhang

cha-zhang commented on Jun 4, 2017

@cha-zhang
Member

Thanks!

If anyone else has strong reasons to use BrainScript, please explain your use case by commenting here or sending me email directly. We will aggregate the feedback and plan the future of CNTK accordingly.

ghost mentioned this on Jun 5, 2017
ghost
JohnCraigPublic

JohnCraigPublic commented on Jun 5, 2017

@JohnCraigPublic

Never used Python, and while I hear its 'easy' -- I have found Branscript to be very easy -- so it was a simpler path for me to take, as opposed to setting up and learning python. 3.4? 3.5? what is Anaconda? etc etc. I also live in a "product world" of C, C++, and some C#. No python in anything we do.

cha-zhang

cha-zhang commented on Jun 6, 2017

@cha-zhang
Member

The machine learning community has chosen Python, and that's why all toolkits has Python bindings. In the case of CNTK, we started with C++, and Python is just a very thin wrapper on it. That's why CNTK's python binding can run as efficient as BrainScript.

We will continue optimizing the underneath C++ code, and Python will subsequently benefit from that.

skynode

skynode commented on Jun 6, 2017

@skynode

@cha-zhang Correct, the machine learning community has chosen Python but most other toolkits like CNTK have also used C++ at their cores.

Now the extent to which each toolkit has supported the community-beloved Python bindings (I actually love Python) is where the toolkits differ especially in performance. CNTK has a thin Python wrapper and so retains many of the superior performance affordable to using C++, while Tensorflow, for instance, has extended Python support beyond its core C++ codebase and subsequently underperforms CNTK.

Maintaining that superior performance at a higher level of abstraction is something that BrainScript, due to it's cut-to-the-chase, high (CNTK?) performance design philosophy, is more likely than Python to achieve.

cha-zhang

cha-zhang commented on Jun 6, 2017

@cha-zhang
Member

There is a cost of maintaining and updating BrainScript. Currently, for the same layer, Python and BrainScript go through two paths inside C++, one via V2 library, and one via V1 library. We need to merge them to simplify, and it's not straightforward. An alternative solution (and simpler way) is to factor the V1 library code out and separate them from V2 library. However, it's unlikely we will update V1 code as frequently.

Your input is important to us, and we will discuss and see if there can be a compromise.

ghost
DHOFM

DHOFM commented on Jun 6, 2017

@DHOFM

From the point of a developer who used C# since .net 1.0 BrainScript was very clear to me and one of the reasons i used CNTK for a new prototype where building, instead of TensorFlow or others. Now i did all evaluation and further in Python. Python is ok, i still miss the brackets {} but it´s ok. For training, BrainScript looks more structured, you have a better overview than in Python, so i would recommend to keep it alive. For Syntax Highlighting and so on i renamed a copy of the BrainScript Files to .c so VS Code can show it better. For the Future a full support of BrainScript in VS or VS Code with debugging would be nice or a full support of c# but anyway if the decision is Python only i can live with it...

ebarsoumMS

ebarsoumMS commented on Jun 6, 2017

@ebarsoumMS
Contributor

First if all, thanks everyone for the feedbacks.

@avader906 regarding

"so you made a major break and reset in your process. given that python is the development target - it is understandable you have to divert resources and setup unit test etc environment from that. the logical way would of been to maintain braiscript for unit tests and API development and waterfall functionality into python. not the inverse. imho that is the longer term "correct" engineering route."

The above is not always possible, the goal of v2 was to provide the flexibility needed to write any custom computation graph in addition to high level abstraction, that wasn't possible in v1 graph. We utilized as much as possible from v1, however, when v1 was designed the need of DNN community was different than now. Also, if you look at CNTK Python Layer API, it matches very closely BrainScript version. The performance should always matches, if not that it is a bug.

For adding BrainScript on the top of V2 graph, that is a possibility that depend on the demand.

Regarding:

"To summarize, what migration path are you offering to your NDL and brainscript folks that invested so much into model training?"

You can load and evaluate your model in C++ or python API, so that isn't going away and BS isn't going to be deprecated.

@DHOFM For "From the point of a developer who used C# since .net 1.0 BrainScript was very clear to me", can you explain why? I would have through that Python is more closer and at least you have the debuggability of Python. If we expose training through .Net, will you prefer that versus BrainScript?

vermorel

vermorel commented on Jun 6, 2017

@vermorel
ContributorAuthor

@ebarsoumMS @cha-zhang @JimSEOW Thank you very much for your follow-up. There has been significant discussion on #960. As the original poster here, I would like to share my perspective, as maybe the logical conclusion might be to not push further for BrainScript.

The case is more extensively discussed at http://blog.vermorel.com/journal/2017/6/6/details-on-the-net-first-strategy-for-cntk.html

In short, I submitted this issue while I was under the impression that BrainScript was a core strategy for CNTK. Apparently, it isn't; and this looks fine to me, as long as a .NET-friendly alternative is provided to offer the same degree of correctness by design.

If the CNTK team clearly states that the goal is to make .NET a first-class citizen, then this present issue should probably be dismissed entirely. No need to divert resources from the .NET initiative.

13 remaining items

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @n17s@vermorel@JimSEOW@JohnCraigPublic@skynode

        Issue actions

          BrainScript extension for Visual Studio Code · Issue #1962 · microsoft/CNTK