Path: csiph.com!xmission!news.snarked.org!border2.nntp.dca1.giganews.com!nntp.giganews.com!news.iecc.com!.POSTED.news.iecc.com!nerds-end From: Roger L Costello Newsgroups: comp.compilers Subject: Parsing using a Graphics Processing Unit (GPU)? Date: Mon, 31 Aug 2020 10:35:53 +0000 Organization: Compilers Central Lines: 42 Sender: news@iecc.com Approved: comp.compilers@iecc.com Message-ID: <20-09-001@comp.compilers> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8bit Injection-Info: gal.iecc.com; posting-host="news.iecc.com:2001:470:1f07:1126:0:676f:7373:6970"; logging-data="84131"; mail-complaints-to="abuse@iecc.com" Keywords: parse, performance, comment Posted-Date: 01 Sep 2020 00:44:51 EDT X-submission-address: compilers@iecc.com X-moderator-address: compilers-request@iecc.com X-FAQ-and-archives: http://compilers.iecc.com Xref: csiph.com comp.compilers:2572 Hi Folks, I am reading a book [1] on machine learning and the book says some pretty interesting things: "In the search for more speed, machine learning researchers started taking advantage of special hardware found in some computers, originally designed to improve graphics performance. You may have heard these called graphics cards. ... Those graphics cards contain a GPU, or graphics processing unit. Unlike a general purpose CPU, a GPU is designed to perform specific tasks, and do them well. One of those tasks is to carry out arithmetic, including matrix multiplication, in a highly parallel way. ... GPUs have many more [than CPUs] arithmetic cores, thousands are fairly common today. This means a huge workload can be split amongst all those cores and the job can be done quickly." Neat! Has the parsing community found a way to take advantage of GPUs? From the above excerpt, it appears that GPUs are especially good at arithmetic. When I think of parsing, I don't think of lots of arithmetic. Perhaps someone has devised a way to recast the parsing problem into an arithmetic problem? Any thoughts you might have on: (a) parsing-using-GPUs, and (b) recasting-the-parsing-problem-into-an-arithmetic-problem would be appreciated. /Roger [1] "Make Your First GAN with Pytorch" by Tariq Rashid [Parsing is not usually an important factor in compiler performance. The slow parts are the lexer, because it has to look at every character of the input, and some optimizations that have to analyze the entire intermediate form of the program. The first step in lexing is to identify what class each character is, e.g., identifier, white space, or operator. Perhaps a GPU could do vector lookups to speed that up. For optimizations, I can sort of imagine how some analyses like reachability might be expressible as matrices. -John]