My project takes too long to program

Started by
89 comments, last by JoeJ 3 years ago

After few years programming for the GPU, i realized i would need 10 years more to finish. The task i try to solve is computationally too heavy. The need of parallelism made me program for the GPU. And now it is fine. It is fast(acceptably slow). But took me years of programming. And i am barely in the beginning of my project.

Few months ago i started realizing that the programming itself as a process is too much of work. But i kept programming monster shaders like a zombie coder.

The main problem is - it takes ages to program a good parallelism. If i were coding in C# for a single core CPU of 10000x4Ghz clock, i would be able to develop in a reasonable time. Still lot of work, but already manageable.

Monster shaders made in a garage - super fast to execute, super slow to program. Manually programming complicated tasks is becoming deprecated as a concept. Accessible to anybody.

NNs - super easy to program(compared to traditional programming). Super slow to execute. Still in development. As a concept it is the future. Serious projects in NNs are accessible only to supercorps.

Higher level parallel programming languages or extensions - i never felt convinced to use them instead HLSL.

When i try to repeat what my program does with NNs, they fall behind a handwritten code in all aspects except productivity. NNs that do the same as my program are super mega slower to execute(once trained) than the hand written program. And i have tons of other problems characteristic for NNs too. Like getting an "exact" answer between -inf to +inf as my shaders do.

In theory, I know the complete program flow. Every time i found a problem so far, i was able to solve it fast. So i don't need ML to find the unknown features for me. I am firmly convinced that any problem that pops up in the future, i would be able to solve it fast. Teaching an app instead programming it, it takes less time in the end(theoretically). This is what i need the most - productivity. My task is huge, but not unknown for me.

I love the concept of NNs, but so far, intelligent design beats ML in everything, except in productivity.

Still, i feel a very strong urge to abandon programming and move to ML. I feel inside, that ML is the future and i feel that typing code by hand will soon be deprecated.

NNs are still full of problems at this stage, but if in 10 years a NN is truly able to create content like a human does, in this case, right now is the moment to start working in NNs and be prepared when that moment comes. There is still a lot for me to learn and catch up with.

I feel like i should right now stop programming, and install TensorFlow. But at the same time it is very hard to abandon a project that took so much of my time. Because if i move to NNs now, i would abandon my project. I have not enough Flops for serious NN development. I would be just learning about NNs, preparing myself for the future.

PS: In my opinion..

Advertisement

Wut? You are going to give up on your top secret premature optimization journey in the basement?
Isn't it a bit late for your sudden enlightenment? You knew all those things years ago already, no?

Regarding your comments about ML… i know nothing about ML. But obviously you also do not. And tbh, i doubt this would change. Prediction: Just wasting some more years without an outcome.

So i propose you explore some alternatives first:

  1. Stop with secrets. Tell us what your compute shader of doom can actually do, finally. I deserve it. It was me who has teached you lots about those cute little many cores. I wanna know for what.
    If you are open to discussion, you get feedback and inspiration for free. Pay attention to disagreement, let it change your mind. Change is evolution. Secrets in a basement only gives you isolation. You get stuck. Stop that long lasting but short cycle. Missing productivity is not the cause of your issue.
  2. Take a break and work on something else. But please, something achievable, something realistic, something small.
  3. Take what you have and get in contact with business which might benefit from your work.
    If that sounds pointless, read proposal 1 again, react, and hope for better proposals after that.

JoeJ said:
Regarding your comments about ML… i know nothing about ML. But obviously you also do not

How this even works? You should know in order to be able to tell i don't know.

JoeJ said:
You knew all those things years ago already, no?

No, actually. Just recently i realized future is for ML. I guess you will walk this path too. I think you could one day decide to drop all you do and install TensorFlow too. Who knows.

JoeJ said:
Stop with secrets.

This is my personal motivation to invent - me to have it, others to not have it. Or me to decide who to have it and who not. If i share it everything, i will lose my recompense. Without recompense, nothing moves. You can not train a pet without a proper recompense. This is big part of how evolution(and everything) works - recompense motivated action. If i share my stuff, the sole act of somebody else having one more GPU than me, already makes him finish sooner than me…. using my effort as a base. In my opinion it is not fair.

I use free software myself, but the creators decided it is fine with them. I decided for myself secrecy gives a meaning to my work. Everybody finds his own motivation, and decides what is his own recompense.

JoeJ said:
Take what you have and get in contact with business which might benefit from your work.

This is not compatible with secrecy. And much less compatible with having not a product yet. Having only the ideas and lot of code. Nothing sells better than a demonstration. Many people try to sell vapor by promising: "when i finish it, it will be a time machine using antimatter…. believe me!". When i have something to show and to be a solid proof, not a trick, i could contact somebody with capital.

JoeJ said:
Take a break and work on something else.

This leads to remorses.

JoeJ said:
And tbh, i doubt this would change.

I learned the basics that would allow me to decide now - "is it worth the ML or not. For what case it is worth and for what not." There is lot more to learn. Maybe i will never move further this point. Maybe the things to learn that come further are too much for me. But right now i believe the things i said about ML are based on some knowledge. If some times i don't express myself well, ask me, i will clarify. Nobody likes large opening posts. Ask me about something i said and i will clarify what i meant.

Let me elaborate a bit about the main idea of my rant - “new programming paradigm of ML is (probably) deprecating traditional programming” -

Traditional programming -

ML training -

You could write in your office an app typing code manually, 12h a day, every day for years.
And in my garage, I could just take a folder with the examples and drag-and-drop them over the icon of a NN(intentionally simplified example). Then I wait. No programming at all.

We both have a product now that does the same thing. I finished sooner than you. I sold it before you and nobody needs your program now. This makes sense only for some tasks. But in the future, ML could deprecate traditional programming in most of the tasks. IF it evolves enough. And theoretically, NNs can simulate any program, so, in theory all programmers could be deprecated. In theory… in the future…


This person explains how ML as a concept, attempts to solve the “I have too many millions of lines of code to program. I will never finish” problem -
(it is a video from YT, could take time to load. Time is in the link)

https://youtu.be/KNAWp2S3w94?t=49

NikiTo said:
How this even works? You should know in order to be able to tell i don't know.

I assume so because you approached it the same way than with ray tracing: Instead learning the basics, and a small example which works, you designed a big and flexible API based on assumptions of how it works. Now you say ML is easy and does not even need programming, which i'm sure of as a very naive impression from the distance.

NikiTo said:
If i share my stuff, the sole act of somebody else having one more GPU than me, already makes him finish sooner than me…

Your anxiety blocks you from understanding my proposal, which simply is to tell us WHAT your work can do, not HOW it works. Tell us what it could do. Somebody might have an idea of application or even a need for it. Somebody might be interested.

And much less compatible with having not a product yet. Having only the ideas and lot of code. Nothing sells better than a demonstration.

After so many years of working i'm sure you have something more than just an idea, in contrast to RT or ML. There must be some results. What is it?

When i have something to show and to be a solid proof, not a trick, i could contact somebody with capital.

But you realized you never get there to have something finished to show. So either discuss current stat, or put it into thrash, delete it, and start the next journey to the same place. For what?

I learned the basics that would allow me to decide now - "is it worth the ML or not. For what case it is worth and for what not."

This is not basics of ML. This is how to build up assumptions. To learn the true basics, start with some small tutorial. I even gave you a link and noticed your reaction self justification of ignorance, back then.

Let me elaborate a bit about the main idea of my rant

No. I'm skipping that section.

Also ignoring youtube videos of people talking. Never learned anything there.

So, again: What function has your compute shaders? If it has none, why did you optimize it for years? If it is non, maybe programming just is not you thing.

It is still about computer vision, yes? Could i give it a small framebuffer of a game, and it could make some sense out of it, could it help with game AI?

JoeJ said:
Now you say ML is easy and does not even need programming, which i'm sure of as a very naive impression from the distance.

I don't talk about the code in Python that operates on NNs. I talk about your own app. You don't write code there. Not a single line of code. ML third party tools will create a NN that simulates your app. And the code to operate the NN is short. Plus, IIRC Microsoft offers the option to work with NNs by dragging icons around an IDE.

In the case of RT - you could manually write the code for intersections between rays and triangles, then write the functions for how to apply lighting to the colors. And you compile it.
With the new paradigm, you write nothing of that. You show Ray Tracing to a NN and that's all. Optionally you can write code to setup you NN. But you write ZERO code for ray-triangle intersection. Zero code for PBR lighting.

This is what i meant. I hope it is now clearer. (it would become clearer if you watched the video)

JoeJ said:
Your anxiety blocks you from understanding my proposal, which simply is to tell us WHAT your work can do, not HOW it works. Tell us what it could do. Somebody might have an idea of application or even a need for it. Somebody might be interested.

In my opinion Computer Vision is the key for robots mimicking humans. We humans receive the vast majority of all of our info through vision. Plus it is my personal choice to work on visual stuff. Other people enjoy working in finances for example.

JoeJ said:
No. I'm skipping that section. Also ignoring youtube videos of people talking. Never learned anything there.

If is a video from the official channel of TensorFlow. It is not a random youtuber talking about tech. I tried to dig that piece of video for its friendly, brief and easy to understand explanation on the topic. I would understand if you refuse to read some large paper i gave you the link to. But to watch three minutes of a chunk of a video is easy. You need to watch only around 3 minutes of video starting from the time in the link. Coming form the official page of TensorFlow.

I hope other people who read this thread and are interested in the topic are gonna watch the 3 minutes long chunk from that video.

fleabay said:

@NikiTo This could have been the greatest thread of all time if you had just waited a couple of days.

Naw, that would interfere with GameDev.net transferring to Yahoo answers or something. I'm sure they're going to freeze the databases while migrating.

NikiTo said:
You don't write code there. Not a single line of code. ML third party tools will create a NN that simulates your app.

I thought you are interested in ML development and research, so you have some new function to sell.

I would understand if you refuse to read some large paper i gave you the link to. But to watch three minutes of a chunk of a video is easy.

I don't wanna learn about ML, you do. You complain about your work taking too much time, and after investment of years you are in a bad situation. That's the topic which matters, not general discussion about the work of others.

You can dodge that, and turn topic into general discussion about AI. You also refuse to talk about your own contribution, what you have achieved, what might have a value or maybe not.

If you want to discuss general AI, society, etc., YT is the better place. If you wanna discuss a game or are a fan about it, there are places for that as well. But here we talk about development, usually. That's what we do, and where we ask for each others help or opinion.

Sigh…

There is a clear major misunderstanding of what NNs are and ML (which is a superset above NNs) is. They are a computing paradigm. Let me give you example of how they can be used (quite specific one):

You write up a simulation or a game - where your inputs are:

  • Race track (binary grid of 1s and 0s - one is obstacle, another is track
  • Car (which is just a bounding box)
  • Controls (steer left/right, accelerate and decelerate)
  • Goal (distance from start/towards finish), success condition is having max distance from start and 0 distance to finish and minimal time

You still have to make properly whole simulation of the game (physics, car mechanics, etc. etc.).

Now, for AI driving you could:

  • Derive analytic solution to perfectly drive the car through the track (which would simply be set of controls for each tick - that would define ideal spline - perfect time). Deriving such solution would be very hard (but not impossible!). Of course you'd need to do this for each track.
  • Record other player driving and replay it (which would of course be just simple pre-recorded thing - doesn't work on other tracks though)
  • Make simple simulation to drive through track (which would also work on other tracks)
    • Through just basic decision making
    • Through determining states based on some heuristics
    • etc.
  • Make more complex AI simulation that tries to get close to perfect analytic solution, based on set of rules, and is capable of applying such rules on other tracks … which is ML. (the goal is here very clear - to minimize the time of single drive through race track)
    • This AI has advantage, as if you base it properly on states and inputs that are independent on race track, but could be runtime derived from it, you can use race track (or set of them) as learning process
    • The gained information can then be used in generic way on other race tracks. If your inputs are correct, and your learning phase did indeed create proper responses for various states, then (and only then) your solution can be applied correctly to other race tracks.

For machine learning you will most likely need to determine additional set of inputs (you need to figure out which ones). It can be waypoints, it can be ray casts (i.e. “vision” of the car), it can be literally anything. If your input would be just controls and end goal - it is very unlikely your resulting function would be successful even on learning track (giving it another track would be guaranteed failure), you NEED additional inputs, and no ML will help you determine those.

Clearly at this point you understand, that it is still up to you to determine vast majority of all inputs and “rules” of such approach. NNs are not capable of creativity, compared to self sufficient beings like elephants, chimpanzees, dogs, cats, rats … and sometimes also people, who will determine goal and inputs themselves. Additionally they will also attempt (and rather early) to abuse the whole “game” to reach the goal in an easier way.

Why am I writing this? Because many people (and from your post I got exactly same feeling) think that NNs (and ML in general) are an AI that can “think” and solve any generic problem.

My current blog on programming, linux and stuff - http://gameprogrammerdiary.blogspot.com

JoeJ said:
I thought you are interested in ML development and research, so you have some new function to sell.

Ah, no. I tried that. I can not oversmart the devs who invented RNN, LSTM stuff.

JoeJ said:
If you want to discuss general AI, society, etc., YT is the better place. If you wanna discuss a game or are a fan about it, there are places for that as well. But here we talk about development, usually. That's what we do, and where we ask for each others help or opinion.

This is the Lounge and this is programming related. I am not asking for help, just started a discussion.


DLSS showed ML has things to offer to gaming world too. Though i am not talking about speeding the rendering, but speeding up the production. Idea → ML → Product. Even if the product is slower to execute than a master piece hand written program. But in the near future, ML will improve, NNs will improve and hardware could become so fast that speed would not be of such a big concern.

I am not talking about DLSS that speeds up execution. I talk about NNs that are trained to simulate a game engine. No coding the rules by hand. Not a single line of code written by hand(regarding the game project, I leave the programming of the NNs aside). And theoretically, complex NN setups can simulate any program. It could be not Pac-man, it could be Photoshop that is simulated.

And i am not talking about the case of AI writing programming code. I talk about training NNs to simulate programs instead manually writing code. AI that writes code is under development too.

(it is a YT video)
https://youtu.be/4OzJUNsPx60

This topic is closed to new replies.

Advertisement