public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Use of AI for process scheduling
@ 2003-09-08 19:28 Timothy Miller
  2003-09-08 21:55 ` Jeff Sipek
                   ` (2 more replies)
  0 siblings, 3 replies; 23+ messages in thread
From: Timothy Miller @ 2003-09-08 19:28 UTC (permalink / raw)
  To: Linux Kernel Mailing List

I just got back from vacation and have 3278 list messages to sift
through.  (Yay.)  I wouldn't be surprised, therefore, if others were
already discussing this, but I've been thinking of some ideas over the
past week that we may be helpful for the advancement of intelligent
process scheduling.

To begin with, let's consider the parts of an intelligent system:

1) Inputs (ie. properties and behaviors of processes)
2) Heuristics
3) Outputs (ie. dynamic priorities, etc.)

Up to this point, the interactive scheduler has been designed in a very
expert-system-like manner.  Human experts observe behaviors and define
heuristics.  Ultimately, we do want a solid set of heuristics that are
coded in C, and that's what the current development process has been
working directly toward.

The progress has been slow, and there have been a lot of false starts
and tangents which have been discarded.  This is all how development
works, and it's important to explore all possibilities.  But what I
would like to propose is that we work on a way to accelerate that
process, and that is to make use of machine learning.  We move from
expert systems to artificial intelligence, because the heuristics are
determined by the machine and are therefore dynamic.

Basically, we need to write and install into the kernel an AI engine
which uses user feedback about the "feel" of the system to adjust
heuristics dynamically.  For instance, if the user sees that the system
is misbehaving, they can pause the system in the kernel debugger,
examine process priorities, and indicate what "outputs" from the AI
engine are wrong.  It then learns from that.  Heuristics can be tweaked
until things run as desired.  At that point, scheduler developers trade
emails in the AI heuristic language.

Obviously, this AI engine will be slow and add a huge amount of
processing overhead.  The idea is to determine what the heuristics are,
and then to release a kernel, recode the heuristics in C.

We have a number of options for what kinds of AI engines we use.  A 
neural net is something that's relatively easy to train, but beyond a 
certain level of complexity, it's impossible to make much sense out of 
the weights.  Genetic algorithms are probably out of the question.

The ideal situation would be to have a rule processor that uses a script 
language of sorts (lots of if-thens with some math, etc.) to compute on 
inputs and produce directives to the scheduler (dynamic priorities, but 
perhaps more) -- but what would produce the script?  How do you turn 
user feedback automatically into better rules?  But at the very least, 
it could speed up development by making scheduler behavior dynamically 
programmable.  If a priority inversion occurs and you stop the kernel to 
examine it, the AI engine could report to you what combination of rules 
were used to cause that condition.  You then dynamically change the 
rules and observe the effects.

I have huge gaps in my knowledge of AI, so I'm hoping some LKML members 
who are experts on this will engage in this discussion.

I think use of AI could be applied to the development of MANY parts of 
the kernel.  Obviously, the I/O scheduler could benefit.  But what about 
intelligently dealing with failure conditions?

Maybe AI could be useful in a running kernel, at least as an observer. 
I read an article about self-correcting systems in space craft.  There 
is the logic of the system, and then there is an AI model of it.  When 
some component fails to operate properly or the system behaves in an 
unexpected manner, the "model" finds a way to work around the problem. 
This kind of redundancy in a kernel being debugged could be invaluable. 
  In a deployment kernel, it could exist at a reduced level of 
sophistocation.

Another freaky idea is that large parts of the kernel could be rewritten 
in the heuristic language and interpreted during debugging and then 
compiled for release.

Also, some logic which is not computationally intensive could be always 
interpreted because the size of the interpretor plus the size of the 
pcode would be smaller than the size of the object code for the compiled 
version.  This would not be for performance-critical logic in a deployed 
system.

Ok, I know I'm going too far.  Right now, the best application would be 
the process scheduler, but we should start thinking about ways of making 
the system "self aware" and "self correcting" so that when the model 
observes the logic to misbehave, detailed information can be produced 
for debugging purposes.

Naturally, I am interested in contributing to this, but some of what I 
will have to learn to participate will come out of ensuing discussions. 
  I have a lot to learn, but I think if these ideas are valuable, others 
who already know enough will start to do something with them.


^ permalink raw reply	[flat|nested] 23+ messages in thread
* Re: Use of AI for process scheduling
@ 2003-09-09 19:05 John Yau
  0 siblings, 0 replies; 23+ messages in thread
From: John Yau @ 2003-09-09 19:05 UTC (permalink / raw)
  To: linux-kernel; +Cc: miller

>You talk about weights. Would the linux community be willing to put a
neural net into the kernel? I'm
>sure we could optimize it to not take a lot of processing overhead, but
it's an "unknown".

A neural net is a bad idea in something that requires very low processing
overhead.  There's really no way you can optimize it except through hardware
assistance (i.e. a neural network chip).  You have to iterate through every
node and every connection in the neural to get a result, there's no escape
from that.  Too much computing overhead to be of much use in today's general
purpose processors.

>It would
>be scary to some people to be unable to disect the actual workings of it
and have no way of
>determining corner-case behavior from examining code. But if we have, say,
only a 2-layer neural
>net, we might still be able to reverse-engineer it.

You need at the minimum 3 layers to simulate xor, which is a very important
logic function in any decision process, in a feed forward NN (the one you're
describing?).  NNs in general make decent nonlinear classifiers and not much
beyond that, so I doubt even if we were to reverse engineer it, it'd be very
useful except to classify tasks (e.g. CPU hog or not CPU hog), which can
already be done with very simple heuristics.  Most folks doing research in
AI tend to stay away from NNs these days, and use standard linear
regressions, decision trees, hidden markov models, and etc to do classifier
work.

>One thing I was thinking of is that if there is some information about a
process which is inconvenient
>to get normally but could be accessed by a kernel or user-space thread,
then this process could
>feed back info to the scheduler AI for it to do automatic tuning. Some
information that the scheduler
>doesn't have direct (or efficient) access to could be inferred from
information it DOES have access
>to, and that would be learned through adjustment of weights via
backpropogation.

Again, backpropagation training is computationally very very expensive
(actually a order of magnitude more expensive than extracting results from a
NN).  Using gradient descent, to "learn" something, you have to adjust every
single connection weight in the network thousands of times.  To have AI to
schedule something in realtime is asking too much right now and to put it
simply not necessary.

Where I do see AI can solve some problems is when we expose "tuning knobs"
and need some way to get optimal values offline and not realtime.  A very
good example is the connection matrix in the KLAT II beowulf cluster where
they used genetic algorithms to solve for the optimal solution.  In the
current scheduler situation I can see using genetic algorithms to get
optimal values for Ingo, Con, or Nick's schedulers so they can get compiled
into the scheduler.



John Yau

^ permalink raw reply	[flat|nested] 23+ messages in thread
* Use of AI for process scheduling
@ 2003-09-08 18:57 Timothy Miller
  0 siblings, 0 replies; 23+ messages in thread
From: Timothy Miller @ 2003-09-08 18:57 UTC (permalink / raw)
  To: Linux Kernel Mailing List

I just got back from vacation and have 3278 list messages to sift 
through.  (Yay.)  I wouldn't be surprised, therefore, if others were 
already discussing this, but I've been thinking of some ideas over the 
past week that we may be helpful for the advancement of intelligent 
process scheduling.

To begin with, let's consider the parts of an intelligent system:

1) Inputs (ie. properties and behaviors of processes)
2) Heuristics
3) Outputs (ie. dynamic priorities, etc.)

Up to this point, the interactive scheduler has been designed in a very 
expert-system-like manner.  Human experts observe behaviors and define 
heuristics.  Ultimately, we do want a solid set of heuristics that are 
coded in C, and that's what the current development process has been 
working directly toward.

The progress has been slow, and there have been a lot of false starts 
and tangents which have been discarded.  This is all how development 
works, and it's important to explore all possibilities.  But what I 
would like to propose is that we work on a way to accelerate that 
process, and that is to make use of machine learning.  We move from 
expert systems to artificial intelligence, because the heuristics are 
determined by the machine and are therefore dynamic.

Basically, we need to write and install into the kernel an AI engine 
which uses user feedback about the "feel" of the system to adjust 
heuristics dynamically.  For instance, if the user sees that the system 
is misbehaving, they can pause the system in the kernel debugger, 
examine process priorities, and indicate what "outputs" from the AI 
engine are wrong.  It then learns from that.  Heuristics can be tweaked 
until things run as desired.  At that point, scheduler developers trade 
emails in the AI heuristic language.

Obviously, this AI engine will be slow and add a huge amount of 
processing overhead.  The idea is to determine what the heuristics are, 
and then to release a kernel, recode the heuristics in C.


^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2003-09-09 19:05 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-09-08 19:28 Use of AI for process scheduling Timothy Miller
2003-09-08 21:55 ` Jeff Sipek
2003-09-08 22:56   ` Timothy Miller
2003-09-08 22:28 ` Felipe Alfaro Solana
2003-09-08 23:01   ` Timothy Miller
2003-09-08 23:57     ` David Lang
2003-09-09  0:34       ` Timothy Miller
2003-09-09  1:40         ` Robin Rosenberg
2003-09-09  1:57           ` Robin Rosenberg
2003-09-09 15:16           ` Timothy Miller
2003-09-09 15:14             ` Robin Rosenberg
2003-09-08 22:57 ` William Lee Irwin III
2003-09-08 23:06   ` Mike Fedyk
2003-09-08 23:14     ` William Lee Irwin III
2003-09-09  0:22       ` Timothy Miller
2003-09-09  1:05         ` William Lee Irwin III
2003-09-09 15:08           ` Timothy Miller
2003-09-09 17:47             ` William Lee Irwin III
2003-09-09  0:06     ` Timothy Miller
2003-09-09  1:19       ` Rick Lindsley
2003-09-09 15:11         ` Timothy Miller
  -- strict thread matches above, loose matches on Subject: below --
2003-09-09 19:05 John Yau
2003-09-08 18:57 Timothy Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox