📜 ⬆️ ⬇️

Machine Learning and Intel Xeon: Tencent In-Game Purchasing Advisory System

Nowadays, online games are very popular, especially among young people. Games take up free time, often family members or friends become virtual associates or enemies. In many cases, players need to buy something in order to improve their character and gain an advantage over other gamers.


- Go horse, century of will not be seen!

In order to improve the way users interact, Tencent has implemented a recommendation system. This system is based on machine learning methods and is designed to help users make decisions about in-game purchases.

Tencent business is based on the Internet. The company offers many services, including social network, web portals, e-commerce solutions and multiplayer online games. Here we will talk about the recommender systems , the machine learning algorithms that Tencent uses, and how Intel Xeon processors helped improve the performance of the Tencent system.
')

Recommender systems


A recommendation system is a mechanism that produces a list of recommended items for a user who can choose from one of them. Such systems are widely used to help users decide exactly what they need. These systems are not limited to games. They are used for the selection of musical compositions, films, scientific publications and so on.

In the case of Tencent, one of the uses of the recommender system is to advise the user of gaming products that meet their needs.

The recommendation system creates a list of elements using the following methods: collaborative filtering , content filtering , and a hybrid approach .

Collaborative filtering is an algorithm that issues recommendations based on estimates or behavior of users of the system. It analyzes activity or preferences and predicts, based on similar features of already studied and new users, what the latter might like.

The content filtering algorithm bases recommendations on the properties of objects, information about the user and his interests.

The hybrid algorithm includes the best of the two approaches described above. Tencent, in its recommendation system, uses a machine learning algorithm based on logistic regression. Let's tell in a few words about what kind of algorithm.

Logistic regression


Logistic regression is a statistical method of predictive analysis. It is one of the most popular machine learning methods for binary classification. Such a classification implies the existence of two classes. For example, "win" or "loss", "yes" or "no", "true" or "false", "1" or "0". Like, let's say, happens when betting on races. The horse will either win the race or lose, that is, there are two classes: “win” and “lose”. In this case, the target (dependent) variable is the rate. It will be 1 if the horse wins the race, and 0 otherwise.

Logistic regression is a way to find the probability of the logarithm of the odds ratio for an event using the following equation:


p is the probability of having an event.
1-p is the probability of no event.
β - weight.
x - independent variables.

In the course of the calculations, the coefficients β are found in the formula above to predict the probability of an event occurring.

Tencent and Intel Xeon E5 v4 Recommended System


Tencent's machine learning system analyzes huge amounts of player behavior data in order to formulate recommendations on which game items they should use. Thus, we need serious computational power to accelerate the learning model. DGEMM is actively used to calculate logistic regression coefficients . DGEMM is a matrix multiplication function for double-precision floating-point numbers.

The machine learning system uses the DGEMM feature through the Intel Math Kernel Library (Intel MKL). Intel Xeon E5 v4 processors support the Intel Advanced Vector Extensions 2 (Intel AVX2) instruction set. Intel MKL is well optimized, it allows you to achieve very high performance using Intel AVX2. The library automatically detects new processor features, and, if it is designed for it, uses them. Therefore, if Intel MKL is involved in a certain project, to ensure the best level of performance on new processors, it is enough to keep the library up to date.

Performance testing


Here we compare the performance of dual-processor systems when working with an application that implements the Tencent machine learning algorithm.

The first system is based on Intel Xeon E5-2699 v3 (2.3 GHz, 18 cores, 45 MB of cache memory) and is equipped with 128 GB of RAM (DDR4-2133 MT / s).

The second uses Intel Xeon E5-2699 v4 processors (2.2 GHz, 22 cores, 55 MB of cache memory) and the same memory size and characteristics.

Red Hat Enterprise Linux 7.2-kernel 3.10.0-327 is installed on the test machines. The following software is used: GNU C Compiler Collection 4.8.2, OpenJDK 7, Spark 1.5.2, Intel MKL 11.3.

The following test results show an improvement in application performance, and, accordingly, a coefficient calculation module.


Comparison of application performance using Intel Xeon E5-2699 v3 and v4 processors.

The application supports scaling when running on Intel Xeon E5-2699 v4, which has more cores, it can run more parallel processes than on Intel Xeon E5-2699 v3, which leads to a decrease in system learning time and productivity growth.

And here is the result of tests on Intel Xeon E5-2699 v4 with the Intel AVX2 instruction set disabled and enabled. It can be seen that with AVX2, the logistic regression coefficient calculation module works 44% faster.


Comparison of the performance of the logistic regression coefficient for the Intel Xeon E5-2699 v4 with disabled and enabled Intel AVX2

Please note that the above test results are valid for a specific set of software and hardware, they also reflect the results of optimizing software for Intel processors. Any configuration changes can change these results. The same, in terms of the impact of configuration on the results, applies to universal performance tests. Therefore, making a decision on purchasing equipment costs, firstly, to use various sources of information about performance, and secondly, to take into account how a combination of, say, a certain microprocessor and RAM or other hardware and software components of the system may affect performance. Details on the performance of Intel systems can be found here .

findings


The recommendation system for in-game purchases is built into Tencent games. Optimizing its performance allows you to speed up the decision-making process, which allows the system to quickly recommend players the most suitable game items. Intel MKL uses the Intel AVX2 instruction set, which leads to improved performance of the applications in which it is used on systems equipped with Intel Xeon processors.

Source: https://habr.com/ru/post/313648/


All Articles